Changeset 423 for trunk/Platform.pas
- Timestamp:
- Apr 25, 2022, 6:01:01 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Platform.pas
r290 r423 1 1 unit Platform; 2 3 {$mode delphi}{$H+}4 2 5 3 interface 6 4 7 5 uses 8 {$IFDEF W indows}Windows,{$ENDIF}9 {$IFDEF Linux}Unix,{$ENDIF}6 {$IFDEF WINDOWS}Windows,{$ENDIF} 7 {$IFDEF UNIX}Unix,{$ENDIF} 10 8 Classes, SysUtils, DateUtils, SyncObjs; 11 9 … … 14 12 implementation 15 13 16 {$IFDEF W indows}14 {$IFDEF WINDOWS} 17 15 var 18 16 PerformanceFrequency: Int64; … … 24 22 function NowPrecise: TDateTime; 25 23 var 26 {$IFDEF Linux}T: TimeVal;{$ENDIF}27 {$IFDEF W indows}TimerValue: Int64;{$ENDIF}24 {$IFDEF UNIX}T: TimeVal;{$ENDIF} 25 {$IFDEF WINDOWS}TimerValue: Int64;{$ENDIF} 28 26 begin 29 27 // Result := Now; 30 28 //try 31 29 //NowPreciseLock.Acquire; 32 {$IFDEF W indows}30 {$IFDEF WINDOWS} 33 31 QueryPerformanceCounter(TimerValue); 34 32 //Result := Int64(TimeStampToMSecs(DateTimeToTimeStamp(Now)) * 1000) // an alternative Win32 timebase … … 36 34 {$ENDIF} 37 35 38 {$IFDEF Linux}36 {$IFDEF UNIX} 39 37 fpgettimeofday(@t, nil); 40 38 // Build a 64 bit microsecond tick from the seconds and microsecond longints … … 51 49 initialization 52 50 53 {$IFDEF W indows}51 {$IFDEF WINDOWS} 54 52 QueryPerformanceFrequency(PerformanceFrequency); 55 53 {$ENDIF}
Note:
See TracChangeset
for help on using the changeset viewer.