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

Function CpuInstantToInstant

library/cpp/yt/cpu_clock/clock.cpp:83–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83TInstant CpuInstantToInstant(TCpuInstant cpuInstant)
84{
85 // TDuration is unsigned and does not support negative values,
86 // thus we consider two cases separately.
87 auto state = GetCalibrationState();
88 return cpuInstant >= state.CpuInstant
89 ? state.Instant + CpuDurationToDuration(cpuInstant - state.CpuInstant, GetTicksToMicroseconds())
90 : state.Instant - CpuDurationToDuration(state.CpuInstant - cpuInstant, GetTicksToMicroseconds());
91}
92
93TCpuInstant InstantToCpuInstant(TInstant instant)
94{

Callers

nothing calls this directly

Calls 3

GetCalibrationStateFunction · 0.85
CpuDurationToDurationFunction · 0.85
GetTicksToMicrosecondsFunction · 0.85

Tested by

no test coverage detected