QueryPerformanceCounter

QueryPerformanceCounter retrieves the current value of the high-resolution performance counter.

Syntax

Copy
BOOL QueryPerformanceCounter(
    [out]    LARGE_INTEGER* lpPerformanceCount
);

Parameters

[out] lpPerformanceCount

Pointer to a variable that receives the current performance-counter value, in counts.

Return Value

If the function succeeds, it returns a non-zero value. If the function fails, it returns 0 (zero). Call GetLastError to get extended error information.

Remarks

Use QueryPerformanceCounter rather than RtGetClockTime. Using RtGetClockTime on multiple processors retrieves times that are not accurately aligned with each other, even when the functions are executed simultaneously.

To specify processor affinity for a thread, use the SetThreadAffinityMask function.

Requirements

Minimum supported version Header Library

wRTOS 1.0 SDK

windows.h

wRTOS_rtss.lib

In Windows applications, this function is available by including RtApi.h and linking to RtApi.lib.

See Also: