MCPcopy Create free account
hub / github.com/apache/brpc / current_task_cpu_clock_ns

Method current_task_cpu_clock_ns

src/bthread/task_group.h:224–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222 pthread_t tid() const { return _tid; }
223
224 int64_t current_task_cpu_clock_ns() {
225 if (_last_cpu_clock_ns == 0) {
226 return 0;
227 }
228 int64_t total_ns = _cur_meta->stat.cpu_usage_ns;
229 total_ns += butil::cputhread_time_ns() - _last_cpu_clock_ns;
230 return total_ns;
231 }
232
233private:
234friend class TaskControl;

Callers 1

bthread_cpu_clock_nsFunction · 0.80

Calls 1

cputhread_time_nsFunction · 0.85

Tested by

no test coverage detected