From: Ketmar Dark Date: Mon, 21 Aug 2017 18:41:51 +0000 (+0300) Subject: xprofiler: made curtime getters public X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=c4f5c9d83f401ccc223dad213eec2a6b6f8a6b23;p=d2df-sdl.git xprofiler: made curtime getters public --- 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.