X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fshared%2Fxprofiler.pas;h=6fb00357b467071a192a46556511fd86b0021780;hb=5af73370d6483479ea1d7c997878188fa3d47c1c;hp=e335e3fc8ee1c0abd2fd4cb361e6082f7cd61a4e;hpb=9d2405d500b579d36f6e2330762a6cd51fbce581;p=d2df-sdl.git diff --git a/src/shared/xprofiler.pas b/src/shared/xprofiler.pas index e335e3f..6fb0035 100644 --- a/src/shared/xprofiler.pas +++ b/src/shared/xprofiler.pas @@ -143,6 +143,10 @@ type end; +function curTimeMicro (): UInt64; inline; +function curTimeMilli (): UInt64; inline; + + implementation {$IF DEFINED(LINUX)} @@ -182,7 +186,7 @@ function curTimeMicro (): UInt64; inline; var r: THPTimeType; begin - if (mFrequency = 0) then initTimerIntr(); + //if (mFrequency = 0) then initTimerIntr(); {$IF DEFINED(LINUX)} clock_gettime(CLOCK_MONOTONIC, @r); result := UInt64(r.tv_sec)*1000000+UInt64(r.tv_nsec) div 1000; // microseconds @@ -193,6 +197,12 @@ begin end; +function curTimeMilli (): UInt64; inline; +begin + result := curTimeMicro div 1000; +end; + + // ////////////////////////////////////////////////////////////////////////// // class function TStopWatch.Create (): TStopWatch; begin @@ -486,4 +496,6 @@ begin end; +begin + initTimerIntr(); end.