[Lazarus] How to program with time in milliseconds?

Michael Schnell mschnell at lumino.de
Thu May 15 11:41:32 CEST 2014


On 05/15/2014 11:18 AM, Michael Van Canneyt wrote:
>
>
> fpGetTimeOfDay is used to implement Now(). This should not be changed.

Why not, If there are better ways ?

I did a quick search in the RTL sources and found that there is 
"GetTickCount64" that maybe could be used as a central cross-platform 
function to implement certain timing stuff (including NOW).

Right now this is not the case. fpGetTimeOfDay is called in several 
other locations. I suppose, here GetTickCount64 could be used.

Depending on "HAVECLOCKGETTIME" GetTickCount64 just calls fpGetTimeOfDay.

In - more advanced ? - archs. GetTickCount64 calls "clock_gettime".

In my X86 32 Bit Linux it indeed does call clock_gettime.

But this again is just a system call and so I suppose it does not help 
to improve performance.

-Michael




More information about the Lazarus mailing list