OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
InjectTimer Struct Reference

#include <measure.h>

+ Collaboration diagram for InjectTimer:

Public Member Functions

 InjectTimer (std::string const &description, int const &lineNum, std::string const &func)
 
 ~InjectTimer ()
 

Public Attributes

std::string description_
 
int lineNum_
 
std::string func_
 
std::chrono::steady_clock::time_point start_
 

Detailed Description

Definition at line 98 of file measure.h.

Constructor & Destructor Documentation

InjectTimer::InjectTimer ( std::string const &  description,
int const &  lineNum,
std::string const &  func 
)
inline

Definition at line 99 of file measure.h.

References description_, func_, g_enable_debug_timer, logger::INFO, lineNum_, LOG, start_, and timer_start().

100  : description_(description), lineNum_(lineNum), func_(func) {
101  if (g_enable_debug_timer) {
102  start_ = timer_start();
103  LOG(INFO) << "Timer start " << std::setfill(' ') << std::setw(35) << description_
104  << " " << std::setw(35) << func_ << ":" << std::setw(5) << lineNum_;
105  }
106  }
std::chrono::steady_clock::time_point start_
Definition: measure.h:120
#define LOG(tag)
Definition: Logger.h:285
bool g_enable_debug_timer
Definition: Logger.cpp:17
int lineNum_
Definition: measure.h:117
std::string func_
Definition: measure.h:118
std::string description_
Definition: measure.h:116
Type timer_start()
Definition: measure.h:42

+ Here is the call graph for this function:

InjectTimer::~InjectTimer ( )
inline

Definition at line 108 of file measure.h.

References description_, func_, g_enable_debug_timer, logger::INFO, lineNum_, LOG, start_, and timer_stop().

108  {
109  if (g_enable_debug_timer) {
110  LOG(INFO) << "Timer end " << std::setfill(' ') << std::setw(35) << description_
111  << " " << std::setw(35) << func_ << ":" << std::setw(5) << lineNum_
112  << " elapsed " << timer_stop(start_) << " ms";
113  }
114  }
std::chrono::steady_clock::time_point start_
Definition: measure.h:120
#define LOG(tag)
Definition: Logger.h:285
bool g_enable_debug_timer
Definition: Logger.cpp:17
int lineNum_
Definition: measure.h:117
TypeR::rep timer_stop(Type clock_begin)
Definition: measure.h:48
std::string func_
Definition: measure.h:118
std::string description_
Definition: measure.h:116

+ Here is the call graph for this function:

Member Data Documentation

std::string InjectTimer::description_

Definition at line 116 of file measure.h.

Referenced by InjectTimer(), and ~InjectTimer().

std::string InjectTimer::func_

Definition at line 118 of file measure.h.

Referenced by InjectTimer(), and ~InjectTimer().

int InjectTimer::lineNum_

Definition at line 117 of file measure.h.

Referenced by InjectTimer(), and ~InjectTimer().

std::chrono::steady_clock::time_point InjectTimer::start_

Definition at line 120 of file measure.h.

Referenced by InjectTimer(), and ~InjectTimer().


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