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

Method enable

src/processSampler.cpp:63–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void ProcessSampler::enable(const long sampling_interval) {
64 if (_sampling_interval != sampling_interval) {
65 _sampling_interval = sampling_interval;
66 _last_sample_time = 0;
67 _process_history.clear();
68 }
69}
70
71bool ProcessSampler::shouldSample(const u64 wall_time) const {
72 return _sampling_interval > 0 && wall_time >= _last_sample_time + _sampling_interval;

Callers

nothing calls this directly

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected