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

Function ThreadCPUTime

util/system/datetime.cpp:61–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61ui64 ThreadCPUTime() noexcept {
62#if defined(_win_)
63 FILETIME creationTime, exitTime, kernelTime, userTime;
64 GetThreadTimes(GetCurrentThread(), &creationTime, &exitTime, &kernelTime, &userTime);
65 return ToMicroSeconds(userTime) + ToMicroSeconds(kernelTime);
66#elif defined(Y_HAS_CLOCK_GETTIME)
67 struct timespec ts;
68 clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts);
69 return ToMicroSeconds(ts);
70#else
71 return 0;
72#endif
73}
74
75ui32 Seconds() noexcept {
76 struct timeval tv;

Callers

nothing calls this directly

Calls 1

ToMicroSecondsFunction · 0.85

Tested by

no test coverage detected