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::user_clock Struct Reference

this component extracts only the CPU time spent in user-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::user_clock:

Public Types

using ratio_t = std::nano
 
using value_type = int64_t
 
using base_type = base< user_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 () noexcept
 

Detailed Description

this component extracts only the CPU time spent in user-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 78 of file components.hpp.

Member Typedef Documentation

◆ base_type

◆ ratio_t

Definition at line 80 of file components.hpp.

◆ value_type

Definition at line 81 of file components.hpp.

Member Function Documentation

◆ description()

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

Definition at line 85 of file components.hpp.

85 { return "CPU time spent in user-mode"; }

◆ get()

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

Definition at line 90 of file components.hpp.

91  {
92  auto val = load();
93  return static_cast<double>(val / static_cast<double>(ratio_t::den) *
95  }
static int64_t get_unit()

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

Referenced by get_display().

◆ get_display()

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

Definition at line 96 of file components.hpp.

96 { return get(); }
double get() const noexcept
Definition: components.hpp:90

References get().

◆ label()

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

Definition at line 84 of file components.hpp.

84 { return "user"; }

◆ record()

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

Definition at line 86 of file components.hpp.

87  {
88  return tim::get_clock_user_now<int64_t, ratio_t>();
89  }

Referenced by start(), and stop().

◆ start()

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

Definition at line 97 of file components.hpp.

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

References record().

◆ stop()

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

Definition at line 98 of file components.hpp.

99  {
100  value = (record() - value);
101  accum += value;
102  }

References record().


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