| 15 | namespace { |
| 16 | |
| 17 | int64_t WallClockMs() { |
| 18 | using namespace std::chrono; |
| 19 | return duration_cast<milliseconds>(steady_clock::now().time_since_epoch()).count(); |
| 20 | } |
| 21 | |
| 22 | // Reads utime+stime from /proc/<pid>/stat. Returns 0 if the pid is gone. |
| 23 | // /proc/<pid>/stat format: pid (comm) state ppid ... utime(14) stime(15) ... |