mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 21:48:35 +02:00
* clock_gettime uses timespec, not timeval
git-svn-id: trunk@27446 -
This commit is contained in:
parent
37eb616960
commit
f61e27ec8e
@ -333,10 +333,18 @@ End;
|
||||
function GetTickCount64: QWord;
|
||||
var
|
||||
tp: TTimeVal;
|
||||
{$IFDEF HAVECLOCKGETTIME}
|
||||
ts: TTimeSpec;
|
||||
{$ENDIF}
|
||||
|
||||
begin
|
||||
{$IFDEF HAVECLOCKGETTIME}
|
||||
if clock_gettime(CLOCK_MONOTONIC, @tp)<0 then
|
||||
{$ENDIF}
|
||||
{$IFDEF HAVECLOCKGETTIME}
|
||||
if clock_gettime(CLOCK_MONOTONIC, @ts)=0 then
|
||||
begin
|
||||
Result := (Int64(ts.tv_sec) * 1000) + (ts.tv_nsec div 1000000);
|
||||
exit;
|
||||
end;
|
||||
{$ENDIF}
|
||||
fpgettimeofday(@tp, nil);
|
||||
Result := (Int64(tp.tv_sec) * 1000) + (tp.tv_usec div 1000);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user