What does GetTickCount () really measure?

I want to know what the Windows API actually measures GetTickCount()? Does it measure the time since the system’s power button was pressed? Does this measure the time taken by boot loaders or the BIOS to boot? I am trying to measure the boot time in Windows 7.

+5
source share
3 answers

You should not regard it as a measurement of time “since”. Use it only as a relative source of synchronization. In other words, call GetTickCountonce, then do something, then call it again, and then subtract. Do not use the absolute value of the number of ticks.

, Windows " " 49,7 , .

+14

, , , - Windows. , " " . , , , Windows - , .

+4

GetTickCount() . GTC undefined.

, , , GTC QueryPerformanceCounter() * 1000 / QueryPerformanceFrequency(), , , QPC QPF.

Windows .

  • \\.\System\System Up Time. . , Wow64, PdhCollectQueryData NO_DATA.

  • WMI LastBootUpTime Win32_OperatingSystem table. , , , . , WMI . , systeminfo, WMI , 1 .

- GetSystemTimes / / , , CPU . , .

So, overall, there is no simple and easy way to determine the boot time or uptime in Windows. Nothing comparable to reading /proc/uptimeon * nix. Surprise, surprise.

0
source

All Articles