[fpc-devel] About GetTickCount

Hans-Peter Diettrich DrDiettrich1 at aol.com
Thu Nov 3 18:15:17 CET 2011


zeljko schrieb:

> This is what MSDN says about GetTickCount:
> 
> Retrieves the number of milliseconds that have elapsed since the system 
> was started, up to 49.7 days (what they do after 49.7 days ? ).

When the DWORD overflows, Win9x stops to work properly. NT uses an
bigger data type, at least internally.

IMO every OS supports an basic time counter, incremented by interrupts 
(BIOS, DOS) or in hardware, and starting at system boot time. A 
resolution of 10ns, as currently available, requires hardware support of 
course - and such support depends on the machine architecture.

The determination of the current time adjusts the counter value, 
according to the clock frequency, and adds the absolute starting (boot) 
time. Afterwards the timzone shift can be added to that value, when 
local time is required. Then comes the hairy part, the conversion of 
that time into days, years etc., for display purposes.

DoDi





More information about the fpc-devel mailing list