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

Function GetBSDUptime

util/datetime/uptime.cpp:24–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22 }
23
24 TDuration GetBSDUptime() {
25 TInstant beforeNow;
26 TInstant afterNow;
27 TInstant now;
28
29 // avoid race when NTP changes machine time between getting Now() and uptime
30 afterNow = GetBootTime();
31 do {
32 beforeNow = afterNow;
33 now = Now();
34 afterNow = GetBootTime();
35 } while (afterNow != beforeNow);
36
37 return now - beforeNow;
38 }
39} // namespace
40#endif // _darwin_
41

Callers 1

UptimeFunction · 0.85

Calls 2

GetBootTimeFunction · 0.85
NowFunction · 0.70

Tested by

no test coverage detected