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

this clock measures the CPU time within the current process (excludes child processes). 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::process_cpu_clock:

Public Types

using ratio_t = std::nano
 
using value_type = int64_t
 
using base_type = base< process_cpu_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 clock measures the CPU time within the current process (excludes child processes). 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 250 of file components.hpp.

Member Typedef Documentation

◆ base_type

◆ ratio_t

Definition at line 252 of file components.hpp.

◆ value_type

Definition at line 253 of file components.hpp.

Member Function Documentation

◆ description()

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

Definition at line 257 of file components.hpp.

258  {
259  return "CPU-clock timer for the calling process (all threads)";
260  }

◆ get()

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

Definition at line 265 of file components.hpp.

266  {
267  auto val = load();
268  return static_cast<double>(val / static_cast<double>(ratio_t::den) *
270  }
static int64_t get_unit()

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

Referenced by get_display().

◆ get_display()

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

Definition at line 271 of file components.hpp.

271 { return get(); }
double get() const noexcept
Definition: components.hpp:265

References get().

◆ label()

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

Definition at line 256 of file components.hpp.

256 { return "process_cpu"; }

◆ record()

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

Definition at line 261 of file components.hpp.

262  {
263  return tim::get_clock_process_now<int64_t, ratio_t>();
264  }

Referenced by tim::component::process_cpu_util::record(), start(), and stop().

◆ start()

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

Definition at line 272 of file components.hpp.

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

References record().

◆ stop()

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

Definition at line 273 of file components.hpp.

274  {
275  value = (record() - value);
276  accum += value;
277  }

References record().


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