[Lazarus] Better implementation of GetTickcount using clock_gettime

Luca Olivetti luca at wetron.es
Tue Apr 1 20:22:18 CEST 2014


El 01/04/14 20:03, Mattias Gaertner ha escrit:
> 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.

Wow, that was fast. Thank you.

Bye
-- 
Luca Olivetti
Wetron Automation Technology http://www.wetron.es
Tel. +34 935883004  Fax +34 935883007




More information about the Lazarus mailing list