g2o
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
g2o::ScopeTime Class Reference

Class to measure the time spent in a scope. More...

#include <timeutil.h>

Public Member Functions

 ScopeTime (const char *title)
 
 ~ScopeTime ()
 

Private Attributes

std::string _title
 
double _startTime
 

Detailed Description

Class to measure the time spent in a scope.

To use this class, e.g. to measure the time spent in a function, just create and instance at the beginning of the function.

Definition at line 99 of file timeutil.h.

Constructor & Destructor Documentation

◆ ScopeTime()

g2o::ScopeTime::ScopeTime ( const char *  title)

Definition at line 35 of file timeutil.cpp.

std::string _title
Definition timeutil.h:105
double _startTime
Definition timeutil.h:106
double get_monotonic_time()
Definition timeutil.cpp:43

◆ ~ScopeTime()

g2o::ScopeTime::~ScopeTime ( )

Definition at line 38 of file timeutil.cpp.

38 {
39 G2O_DEBUG("{} took {}ms.", _title,
40 1000 * (get_monotonic_time() - _startTime));
41}
#define G2O_DEBUG(...)
Definition logger.h:90

References _startTime, _title, G2O_DEBUG, and g2o::get_monotonic_time().

Member Data Documentation

◆ _startTime

double g2o::ScopeTime::_startTime
private

Definition at line 106 of file timeutil.h.

Referenced by ~ScopeTime().

◆ _title

std::string g2o::ScopeTime::_title
private

Definition at line 105 of file timeutil.h.

Referenced by ~ScopeTime().


The documentation for this class was generated from the following files: