diff options
author | melkov <melkov@yandex-team.ru> | 2022-02-10 16:48:14 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:14 +0300 |
commit | 2c532b38e6aeb4fd88531027c7335690fd34c4e5 (patch) | |
tree | b222e5ac2e2e98872661c51ccceee5da0d291e13 /util/datetime/cputimer.h | |
parent | 438546c8737d5c1fdeb31157dcf999717d930eec (diff) | |
download | ydb-2c532b38e6aeb4fd88531027c7335690fd34c4e5.tar.gz |
Restoring authorship annotation for <melkov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/datetime/cputimer.h')
-rw-r--r-- | util/datetime/cputimer.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/util/datetime/cputimer.h b/util/datetime/cputimer.h index c6559c8de28..7d38d5bdb38 100644 --- a/util/datetime/cputimer.h +++ b/util/datetime/cputimer.h @@ -34,25 +34,25 @@ public: class TProfileTimer { TDuration T; -public: +public: TProfileTimer() { - Reset(); - } + Reset(); + } TDuration Get() const { return TRusage::Get().Utime - T; - } + } TDuration Step() { TRusage r; r.Fill(); TDuration d = r.Utime - T; T = r.Utime; - return d; - } + return d; + } void Reset() { T = TRusage::Get().Utime; - } -}; - + } +}; + /// Return cached processor cycle count per second. Method takes 1 second at first invocation. /// Note, on older systems cycle rate may change during program lifetime, /// so returned value may be incorrect. Modern Intel and AMD processors keep constant TSC rate. @@ -115,7 +115,7 @@ private: time_t Begin; ui64 BeginCycles; -public: +public: TTimeLogger(const TString& message, bool verbose = true); ~TTimeLogger(); |