From c4f5c9d83f401ccc223dad213eec2a6b6f8a6b23 Mon Sep 17 00:00:00 2001 From: Ketmar Dark Date: Mon, 21 Aug 2017 21:41:51 +0300 Subject: [PATCH] xprofiler: made curtime getters public --- src/shared/xprofiler.pas | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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. -- 2.29.2