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_mode_time Struct Reference

This is the total amount of time spent executing in user mode. More...

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

+ Collaboration diagram for tim::component::user_mode_time:

Public Types

using ratio_t = std::micro
 
using value_type = int64_t
 
using this_type = user_mode_time
 
using base_type = base< this_type, value_type >
 

Public Member Functions

double get_display () const
 
double get () const
 
void start ()
 
void stop ()
 
void start (const cache_type &_cache)
 
void stop (const cache_type &_cache)
 

Static Public Member Functions

static std::string label ()
 
static std::string description ()
 
static value_type record ()
 
static value_type record (const cache_type &_cache)
 

Detailed Description

This is the total amount of time spent executing in user mode.

Definition at line 459 of file components.hpp.

Member Typedef Documentation

◆ base_type

◆ ratio_t

Definition at line 461 of file components.hpp.

◆ this_type

◆ value_type

Definition at line 462 of file components.hpp.

Member Function Documentation

◆ description()

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

Definition at line 467 of file components.hpp.

468  {
469  return "CPU time spent executing in user mode (via rusage)";
470  }

◆ get()

double tim::component::user_mode_time::get ( ) const
inline

Definition at line 474 of file components.hpp.

475  {
476  auto val = base_type::load();
477  return static_cast<double>(val) / ratio_t::den * get_unit();
478  }
decltype(auto) load()

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

Referenced by get_display().

◆ get_display()

double tim::component::user_mode_time::get_display ( ) const
inline

Definition at line 473 of file components.hpp.

473 { return get(); }

References get().

◆ label()

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

Definition at line 466 of file components.hpp.

466 { return "user_mode"; }

◆ record() [1/2]

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

Definition at line 471 of file components.hpp.

471 { return get_user_mode_time(); }

Referenced by start(), and stop().

◆ record() [2/2]

static value_type tim::component::user_mode_time::record ( const cache_type _cache)
inlinestatic

Definition at line 492 of file components.hpp.

493  {
494  return _cache.get_user_mode_time();
495  }

◆ start() [1/2]

void tim::component::user_mode_time::start ( )
inline

Definition at line 480 of file components.hpp.

480 { value = record(); }
static value_type record()
Definition: components.hpp:471

References record().

◆ start() [2/2]

void tim::component::user_mode_time::start ( const cache_type _cache)
inline

Definition at line 497 of file components.hpp.

497 { value = record(_cache); }

References record().

◆ stop() [1/2]

void tim::component::user_mode_time::stop ( )
inline

Definition at line 482 of file components.hpp.

483  {
484  auto tmp = record();
485  if(tmp > value)
486  {
487  value = (tmp - value);
488  accum += value;
489  }
490  }

References record().

◆ stop() [2/2]

void tim::component::user_mode_time::stop ( const cache_type _cache)
inline

Definition at line 499 of file components.hpp.

500  {
501  auto tmp = record(_cache);
502  if(tmp > value)
503  {
504  accum += (tmp - value);
505  value = tmp;
506  }
507  }

References record().


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