timemory 3.3.0
Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
tim::component::system_clock Struct Reference

this component extracts only the CPU time spent in kernel-mode. Only relevant as a time when a different is computed Do not use a single CPU time as an amount of time; it doesn't work that way. More...

#include "timemory/components/timing/components.hpp"

+ Collaboration diagram for tim::component::system_clock:

Public Types

using ratio_t = std::nano
 
using value_type = int64_t
 
using base_type = base< system_clock, value_type >
 
using storage_type = empty_storage
 

Public Member Functions

double get () const noexcept
 
double get_display () const noexcept
 
void start () noexcept
 
void stop () noexcept
 

Static Public Member Functions

static std::string label ()
 
static std::string description ()
 
static value_type record () noexcept
 
template<typename... Args>
static opaque get_opaque (Args &&...)
 

Detailed Description

this component extracts only the CPU time spent in kernel-mode. Only relevant as a time when a different is computed Do not use a single CPU time as an amount of time; it doesn't work that way.

Definition at line 45 of file components.hpp.

Member Typedef Documentation

◆ base_type

◆ ratio_t

Definition at line 47 of file components.hpp.

◆ storage_type

Definition at line 66 of file declaration.hpp.

◆ value_type

Definition at line 48 of file components.hpp.

Member Function Documentation

◆ description()

static std::string tim::component::system_clock::description ( )
inlinestatic

Definition at line 52 of file components.hpp.

52{ return "CPU time spent in kernel-mode"; }

◆ get()

double tim::component::system_clock::get ( ) const
inlinenoexcept

Definition at line 57 of file components.hpp.

58 {
59 return load() / static_cast<double>(base_type::get_unit());
60 }
static int64_t get_unit()

References tim::component::base< Tp, Value >::get_unit(), and tim::component::base< system_clock >::load().

Referenced by get_display().

◆ get_display()

double tim::component::system_clock::get_display ( ) const
inlinenoexcept

Definition at line 61 of file components.hpp.

61{ return get(); }
double get() const noexcept
Definition: components.hpp:57

References get().

◆ get_opaque()

template<typename... Args>
static opaque tim::component::empty_base::get_opaque ( Args &&  ...)
inlinestaticinherited

Definition at line 72 of file declaration.hpp.

73 {
74 return opaque{};
75 }

◆ label()

static std::string tim::component::system_clock::label ( )
inlinestatic

Definition at line 51 of file components.hpp.

51{ return "sys"; }

◆ record()

static value_type tim::component::system_clock::record ( )
inlinestaticnoexcept

Definition at line 53 of file components.hpp.

54 {
55 return tim::get_clock_system_now<int64_t, ratio_t>();
56 }

Referenced by start(), and stop().

◆ start()

void tim::component::system_clock::start ( )
inlinenoexcept

Definition at line 62 of file components.hpp.

62{ value = record(); }
static value_type record() noexcept
Definition: components.hpp:53

References record().

◆ stop()

void tim::component::system_clock::stop ( )
inlinenoexcept

Definition at line 63 of file components.hpp.

64 {
65 value = (record() - value);
66 accum += value;
67 }

References record().


The documentation for this struct was generated from the following file: