Show / Hide Table of Contents

Class perf

Code execution time measurement with high precision (API QueryPerformanceCounter).

public static class perf

Namespace: Au
Assembly: Au.dll
Inheritance
object
perf

Properties

Name Description
incremental

If true, times of each new First/Next/Next... measurement are added to previous measurement times. Finally you can call perf.write or perf.toString to get the sums. Usually used to measure code in loops. See example.

mcs

Gets the number of microseconds elapsed since Windows startup. Uses the high-resolution system timer (API QueryPerformanceCounter).

ms

Gets the number of milliseconds elapsed since Windows startup. Uses the high-resolution system timer (API QueryPerformanceCounter).

shared

Gets a reference to a perf.Instance variable in shared memory.

timeTotal

Gets the number of microseconds between perf.first and the last perf.next.

Methods

Name Description
cpu(int)

Executes some code in loop for the specified amount of time. It should make CPU to run at full speed.

first()

Stores current time in the first element of an internal array.

local()

Creates and returns new perf.Instance variable and calls its perf.Instance.First.

next(char)

Stores current time in next element of an internal array.

nw(char)

Calls perf.next and perf.write.

toArray()

Return array of time values collected by calling perf.first and perf.next. Each element is the number of microseconds of each code execution between calling First and each Next.

toString()

Formats a string from time values collected by calling perf.first and perf.next. The string contains the number of microseconds of each code execution between calling First and each Next.

write()

Formats a string from time values collected by calling perf.first and perf.next, and shows it in the output. The string contains the number of microseconds of each code execution between calling First and each Next.