28#include "timemory/components/timing/backends.hpp"
55 return tim::get_clock_system_now<int64_t, ratio_t>();
57 double get() const noexcept
65 value = (
record() - value);
85 return tim::get_clock_user_now<int64_t, ratio_t>();
87 double get() const noexcept
95 value = (
record() - value);
114 return "Total CPU time spent in both user- and kernel-mode";
118 return tim::get_clock_cpu_now<int64_t, ratio_t>();
120 double get() const noexcept
128 value = (
record() - value);
146 return "Wall-clock timer which will continue to increment even while the system "
151 return tim::get_clock_monotonic_now<int64_t, ratio_t>();
153 double get() const noexcept
161 value = (
record() - value);
180 return "Wall-clock timer unaffected by frequency or time adjustments in system "
185 return tim::get_clock_monotonic_raw_now<int64_t, ratio_t>();
187 double get() const noexcept
195 value = (
record() - value);
216 return tim::get_clock_thread_now<int64_t, ratio_t>();
218 double get() const noexcept
226 value = (
record() - value);
246 return "CPU-clock timer for the calling process (all threads)";
250 return tim::get_clock_process_now<int64_t, ratio_t>();
252 double get() const noexcept
260 value = (
record() - value);
281 return "Percentage of CPU-clock time divided by wall-clock time";
287 double get() const noexcept
289 const auto& _data =
load();
290 double denom = (_data.second > 0) ? _data.second : 1;
291 double numer = (_data.second > 0) ? _data.first : 0;
292 return 100.0 *
static_cast<double>(numer) /
static_cast<double>(denom);
308 value = (
record() - value);
344 if(m_derive && wc && cc)
346 value.first = cc->get_value();
347 value.second = wc->get_value();
357 if(m_derive && wc && uc && sc)
359 value.first = uc->get_value() + sc->get_value();
360 value.second = wc->get_value();
370 bool m_derive =
false;
389 return "Percentage of CPU-clock time divided by wall-clock time for calling "
390 "process (all threads)";
396 double get() const noexcept
398 const auto& _data =
load();
399 double denom = (_data.second > 0) ? _data.second : 1;
400 double numer = (_data.second > 0) ? _data.first : 0;
401 return 100.0 *
static_cast<double>(numer) /
static_cast<double>(denom);
415 value = (
record() - value);
443 if(m_derive && wc && cc)
445 value.first = cc->get_value();
446 value.second = wc->get_value();
456 bool m_derive =
false;
475 return "Percentage of CPU-clock time divided by wall-clock time for calling "
482 double get() const noexcept
484 const auto& _data =
load();
485 double denom = (_data.second > 0) ? _data.second : 1;
486 double numer = (_data.second > 0) ? _data.first : 0;
487 return 100.0 *
static_cast<double>(numer) /
static_cast<double>(denom);
501 value = (
record() - value);
529 if(m_derive && wc && cc)
531 value.first = cc->get_value();
532 value.second = wc->get_value();
542 bool m_derive =
false;
tim::mpl::apply< std::string > string
static int64_t get_unit()
this component extracts only the CPU time spent in both user- and kernel- mode. Only relevant as a ti...
double get() const noexcept
static std::string description()
static value_type record() noexcept
static std::string label()
double get_display() const noexcept
this computes the CPU utilization percentage for the calling process and child processes....
double get_display() const noexcept
bool derive(const wall_clock *wc, const user_clock *uc, const system_clock *sc) noexcept
static std::string label()
this_type & operator+=(const this_type &rhs) noexcept
static std::string description()
static value_type record()
bool is_derived() const noexcept
std::pair< int64_t, int64_t > value_type
bool assemble(const wall_clock *wc, const cpu_clock *cc) noexcept
bool assemble(const wall_clock *wc, const user_clock *uc, const system_clock *sc) noexcept
bool derive(const wall_clock *wc, const cpu_clock *cc) noexcept
double serialization() const noexcept
this_type & operator-=(const this_type &rhs) noexcept
double get() const noexcept
clock that increments monotonically, tracking the time since an arbitrary point, and will continue to...
double get() const noexcept
static value_type record()
double get_display() const noexcept
static std::string label()
static std::string description()
clock that increments monotonically, tracking the time since an arbitrary point like CLOCK_MONOTONIC....
static std::string label()
double get() const noexcept
static value_type record()
double get_display() const noexcept
static std::string description()
this clock measures the CPU time within the current process (excludes child processes)....
static std::string description()
static value_type record() noexcept
static std::string label()
double get() const noexcept
double get_display() const noexcept
this computes the CPU utilization percentage for ONLY the calling process (excludes child processes)....
double get_display() const noexcept
double serialization() const noexcept
bool is_derived() const noexcept
static value_type record()
double get() const noexcept
static std::string label()
this_type & operator+=(const this_type &rhs) noexcept
std::pair< int64_t, int64_t > value_type
this_type & operator-=(const this_type &rhs) noexcept
bool assemble(const wall_clock *wc, const process_cpu_clock *cc) noexcept
bool derive(const wall_clock *wc, const process_cpu_clock *cc) noexcept
static std::string description()
this component extracts only the CPU time spent in kernel-mode. Only relevant as a time when a differ...
static value_type record() noexcept
static std::string label()
double get() const noexcept
double get_display() const noexcept
static std::string description()
this clock measures the CPU time within the current thread (excludes sibling/child threads)....
double get() const noexcept
double get_display() const noexcept
static value_type record() noexcept
static std::string label()
static std::string description()
this computes the CPU utilization percentage for ONLY the calling thread (excludes sibling and child ...
double get_display() const noexcept
std::pair< int64_t, int64_t > value_type
bool derive(const wall_clock *wc, const thread_cpu_clock *cc) noexcept
bool is_derived() const noexcept
double get() const noexcept
double serialization() const noexcept
static value_type record()
static std::string description()
this_type & operator+=(const this_type &rhs) noexcept
static std::string label()
this_type & operator-=(const this_type &rhs) noexcept
bool assemble(const wall_clock *wc, const thread_cpu_clock *cc) noexcept
this component extracts only the CPU time spent in user-mode. Only relevant as a time when a differen...
double get_display() const noexcept
static value_type record() noexcept
static std::string description()
double get() const noexcept
static std::string label()
static value_type record() noexcept