lcore.org gitweb
/
lcore.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix md5 length bug
[lcore.git]
/
btime.pas
diff --git
a/btime.pas
b/btime.pas
index ff77de9e8a681a23ae3292c8a604981fe4a3ca93..87801b5416e3abba52d62e3832d7a3c59dc92ae6 100644
(file)
--- a/
btime.pas
+++ b/
btime.pas
@@
-9,6
+9,11
@@
works on windows/delphi, and on freepascal on unix.
\r
\r
unit btime;
\r
\r
\r
unit btime;
\r
+{$ifdef fpc}
\r
+ {$mode delphi}
\r
+{$endif}
\r
+
\r
+{$include lcoreconfig.inc}
\r
\r
interface
\r
\r
\r
interface
\r
\r
@@
-55,6
+60,9
@@
function timestrshort(i:tunixtimeint):string; // Wed Aug 15 16:21:09 2012
function timestriso(i:tunixtimeint):string; // 2012-08-15 16:21:09
\r
function timestrisoutc(i:float):string; // 2012-08-15T14:21:09.255553Z
\r
\r
function timestriso(i:tunixtimeint):string; // 2012-08-15 16:21:09
\r
function timestrisoutc(i:float):string; // 2012-08-15T14:21:09.255553Z
\r
\r
+procedure beginhightimerrate;
\r
+procedure endhightimerrate;
\r
+
\r
{$ifdef mswindows}
\r
function unixtimefloat_systemtime:float;
\r
{$endif}
\r
{$ifdef mswindows}
\r
function unixtimefloat_systemtime:float;
\r
{$endif}
\r
@@
-105,9
+113,7
@@
var
\r
implementation
\r
\r
\r
implementation
\r
\r
-{$ifdef fpc}
\r
- {$mode delphi}
\r
-{$endif}
\r
+
\r
\r
uses
\r
{$ifdef UNIX}
\r
\r
uses
\r
{$ifdef UNIX}
\r
@@
-762,10
+768,19
@@
begin
\r
end;
\r
\r
\r
end;
\r
\r
+procedure beginhightimerrate;
\r
+begin
\r
+ {$ifdef mswindows}timebeginperiod(1);{$endif}
\r
+end;
\r
+
\r
+procedure endhightimerrate;
\r
+begin
\r
+ {$ifdef mswindows}timeendperiod(1);{$endif}
\r
+end;
\r
\r
procedure init;
\r
begin
\r
\r
procedure init;
\r
begin
\r
- {$ifdef
mswindows}timebeginperiod(1);{$endif} //ensure stable unchanging clock
\r
+ {$ifdef
btimehighrate}beginhightimerrate;{$endif}
\r
fillchar(mmtime_driftavg,sizeof(mmtime_driftavg),0);
\r
settimebias := 0;
\r
gettimezone;
\r
fillchar(mmtime_driftavg,sizeof(mmtime_driftavg),0);
\r
settimebias := 0;
\r
gettimezone;
\r