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

Function GetThreadCPUTime

library/cpp/chromium_trace/gettime.cpp:11–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10namespace NChromiumTrace {
11 TInstant GetThreadCPUTime() {
12#ifdef _linux_
13 struct timespec ts;
14 clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts);
15 struct timeval tv;
16 tv.tv_sec = ts.tv_sec;
17 tv.tv_usec = ts.tv_nsec / 1000;
18 return TInstant(tv);
19#else
20 // TODO: add implementations for win32/darwin, move to util
21 return TInstant();
22#endif
23 }
24
25 TInstant GetWallTime() {
26#ifdef _win_

Callers 1

NowMethod · 0.85

Calls 1

TInstantClass · 0.85

Tested by

no test coverage detected