#ifndef _NTEXAPI_H
#if (PHNT_MODE != PHNT_MODE_KERNEL)
//
// Performance Counters
//
/**
* The NtQueryPerformanceCounter routine retrieves the current value of the performance counter,
* which is a high resolution (<1us) time stamp that can be used for time-interval measurements.
*
* \param PerformanceCounter A pointer to a variable that receives the current performance-counter value, in 100-nanosecond units.
* \param PerformanceFrequency A pointer to a variable that receives the current performance-frequency value, in 100-nanosecond units.
* \return NTSTATUS Successful or errant status.
* \remarks On systems that run Windows XP or later, the function will always succeed and will thus never return zero. Use RtlQueryPerformanceCounter instead since no system calls are required.
* \sa https://learn.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancecounter
*/
NTSYSCALLAPI
NTSTATUS
NTAPI
NtQueryPerformanceCounter(
_Out_ PLARGE_INTEGER PerformanceCounter,
_Out_opt_ PLARGE_INTEGER PerformanceFrequency
);
View code on GitHub
#ifndef _NTZWAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwQueryPerformanceCounter(
_Out_ PLARGE_INTEGER PerformanceCounter,
_Out_opt_ PLARGE_INTEGER PerformanceFrequency
);
View code on GitHub
No description available.
This function is documented in Windows SDK.
Result is number of processor ticks after last reset.
It's number of processor ticks per one second.
Another method of uptime
calculation:
UpTime = PerformanceCounter / PerformanceFrequency;