MCPcopy Create free account
hub / github.com/catboost/catboost / DurationToCyclesSafe

Function DurationToCyclesSafe

util/datetime/cputimer.cpp:65–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65ui64 DurationToCyclesSafe(TDuration duration)
66{
67 if (duration.MicroSeconds() <= std::numeric_limits<ui64>::max() / GetCyclesPerSecond()) {
68 return DurationToCycles(duration);
69 }
70 return duration.MicroSeconds() / 1000000 * GetCyclesPerSecond();
71}
72
73TPrecisionTimer::TPrecisionTimer()
74 : Start(::GetCycleCount())

Callers 1

Y_UNIT_TESTFunction · 0.85

Calls 4

GetCyclesPerSecondFunction · 0.85
DurationToCyclesFunction · 0.85
maxFunction · 0.50
MicroSecondsMethod · 0.45

Tested by

no test coverage detected