MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / getProcessCpuTime

Method getProcessCpuTime

src/os_linux.cpp:355–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353}
354
355u64 OS::getProcessCpuTime(u64* utime, u64* stime) {
356 struct tms buf;
357 clock_t real = times(&buf);
358 *utime = buf.tms_utime;
359 *stime = buf.tms_stime;
360 return real;
361}
362
363u64 OS::getTotalCpuTime(u64* utime, u64* stime) {
364 int fd = open("/proc/stat", O_RDONLY);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected