X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/7b8a26e75924ecff47d3e347eb4e2685656c728e..3f8290b4a13c15cf62776aa427f62a8ae77ee07c:/btime.pas diff --git a/btime.pas b/btime.pas index 8218e64..87801b5 100644 --- a/btime.pas +++ b/btime.pas @@ -12,6 +12,9 @@ unit btime; {$ifdef fpc} {$mode delphi} {$endif} + +{$include lcoreconfig.inc} + interface {$ifdef mswindows} @@ -57,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 function timestrisoutc(i:float):string; // 2012-08-15T14:21:09.255553Z +procedure beginhightimerrate; +procedure endhightimerrate; + {$ifdef mswindows} function unixtimefloat_systemtime:float; {$endif} @@ -762,10 +768,19 @@ begin end; +procedure beginhightimerrate; +begin + {$ifdef mswindows}timebeginperiod(1);{$endif} +end; + +procedure endhightimerrate; +begin + {$ifdef mswindows}timeendperiod(1);{$endif} +end; procedure init; begin - {$ifdef mswindows}timebeginperiod(1);{$endif} //ensure stable unchanging clock + {$ifdef btimehighrate}beginhightimerrate;{$endif} fillchar(mmtime_driftavg,sizeof(mmtime_driftavg),0); settimebias := 0; gettimezone;