{$ifdef fpc}\r
{$mode delphi}\r
{$endif}\r
+\r
+{$include lcoreconfig.inc}\r
+\r
interface\r
\r
{$ifdef mswindows}\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
\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
- {$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
{$ifdef mswindows}\r
{-$define winasyncdns}\r
{$endif}\r
+\r
+{-------------------------------------------------------------------------------------}\r
+{btime used to set TimeBeginPeriod(1) on init, so a program was permanently in this state.\r
+doing this is not recommended, so it is no longer done by default.\r
+set this define to get the old behavior back.}\r
+{-$define btimehighrate}\r
+\r