timemory  3.2.1
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::monotonic_clock Struct Reference

clock that increments monotonically, tracking the time since an arbitrary point, and will continue to increment while the system is asleep. More...

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

+ Collaboration diagram for tim::component::monotonic_clock:

Public Types

using ratio_t = std::nano
 
using value_type = int64_t
 
using base_type = base< monotonic_clock, value_type >
 

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 ()
 

Detailed Description

clock that increments monotonically, tracking the time since an arbitrary point, and will continue to increment while the system is asleep.

Definition at line 144 of file components.hpp.

Member Typedef Documentation

◆ base_type

◆ ratio_t

Definition at line 146 of file components.hpp.

◆ value_type

Definition at line 147 of file components.hpp.

Member Function Documentation

◆ description()

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

Definition at line 151 of file components.hpp.

152  {
153  return "Wall-clock timer which will continue to increment even while the system "
154  "is asleep";
155  }

◆ get()

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

Definition at line 160 of file components.hpp.

161  {
162  auto val = load();
163  return static_cast<double>(val / static_cast<double>(ratio_t::den) *
165  }
static int64_t get_unit()

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

Referenced by get_display().

◆ get_display()

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

Definition at line 166 of file components.hpp.

166 { return get(); }
double get() const noexcept
Definition: components.hpp:160

References get().

◆ label()

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

Definition at line 150 of file components.hpp.

150 { return "monotonic_clock"; }

◆ record()

static value_type tim::component::monotonic_clock::record ( )
inlinestatic

Definition at line 156 of file components.hpp.

157  {
158  return tim::get_clock_monotonic_now<int64_t, ratio_t>();
159  }

Referenced by start(), and stop().

◆ start()

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

Definition at line 167 of file components.hpp.

167 { value = record(); }
static value_type record()
Definition: components.hpp:156

References record().

◆ stop()

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

Definition at line 168 of file components.hpp.

169  {
170  value = (record() - value);
171  accum += value;
172  }

References record().


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