[Lazarus] Better implementation of GetTickcount using clock_gettime

Michael Van Canneyt michael at freepascal.org
Wed Apr 2 09:08:15 CEST 2014



On Tue, 1 Apr 2014, Mattias Gaertner wrote:

> On Tue, 01 Apr 2014 12:20:53 +0200
> Luca Olivetti <luca at wetron.es> wrote:
>
>> [...]
>> function GetTickCount64: QWord;
>> var
>>   tp: timespec;
>> begin
>>   clock_gettime(CLOCK_MONOTONIC, @tp);
>>   Result := (Int64(tp.tv_sec) * 1000) + (tp.tv_nsec div 1000000);
>> end;
>> [...]
>
> Thanks. GetTickCount64 now uses it on Linux.

The implementation in Sysutils now does so too, and uses a fallback using gettimeofday.

Michael.




More information about the Lazarus mailing list