MCPcopy Create free account
hub / github.com/apple/foundationdb / getProcessorTimeGeneric

Function getProcessorTimeGeneric

flow/Platform.actor.cpp:224–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222
223#ifdef __unixish__
224static double getProcessorTimeGeneric(int who) {
225 struct rusage r_usage;
226
227 if (getrusage(who, &r_usage)) {
228 TraceEvent(SevError, "GetCPUTime").detail("Who", who).GetLastError();
229 throw platform_error();
230 }
231
232 return (r_usage.ru_utime.tv_sec + (r_usage.ru_utime.tv_usec / double(1e6)) + r_usage.ru_stime.tv_sec +
233 (r_usage.ru_stime.tv_usec / double(1e6)));
234}
235#endif
236
237double getProcessorTimeThread() {

Callers 2

getProcessorTimeThreadFunction · 0.85
getProcessorTimeProcessFunction · 0.85

Calls 2

TraceEventClass · 0.85
detailMethod · 0.80

Tested by

no test coverage detected