hpp-util  4.9.0
Debugging tools for the HPP project.
timer.hh File Reference
#include "boost/date_time/posix_time/posix_time_types.hpp"
#include <boost/date_time/posix_time/posix_time.hpp>
#include <hpp/util/config.hh>
#include <hpp/util/debug.hh>
Include dependency graph for timer.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  hpp::debug::Timer
 
class  hpp::debug::TimeCounter
 Computation of min, max and mean time from a set of measurements. More...
 
struct  hpp::debug::TimeCounter::Scope
 

Namespaces

 hpp
 
 hpp::debug
 

Macros

#define hppStartBenchmark(ID)
 
#define hppStopBenchmark(ID)
 
#define hppDisplayBenchmark(ID)   hppDout (benchmark, #ID << ": "<< _##ID##_timer_.duration ());
 
#define hppBenchmark(data)
 
#define HPP_DEFINE_TIMECOUNTER(name)   ::hpp::debug::TimeCounter _##name##_timecounter_ (#name)
 Define a new TimeCounter. More...
 
#define HPP_SCOPE_TIMECOUNTER(name)
 Compute the time spent in the current scope. More...
 
#define HPP_START_TIMECOUNTER(name)   _##name##_timecounter_.start ()
 Start a watch. More...
 
#define HPP_STOP_TIMECOUNTER(name)   _##name##_timecounter_.stop()
 Stop a watch and save elapsed time. More...
 
#define HPP_DISPLAY_LAST_TIMECOUNTER(name)
 Print last elapsed time to the logs. More...
 
#define HPP_DISPLAY_TIMECOUNTER(name)
 Print min, max and mean time of the time measurements. More...
 
#define HPP_RESET_TIMECOUNTER(name)   _##name##_timecounter_.reset();
 Reset a TimeCounter. More...
 
#define HPP_STREAM_TIMECOUNTER(os, name)   os << _##name##_timecounter_
 Stream (operator<<) to the output stream. More...
 
#define HPP_STOP_AND_DISPLAY_TIMECOUNTER(name)
 

Functions

std::ostream & hpp::debug::operator<< (std::ostream &os, const TimeCounter &tc)
 

Macro Definition Documentation

◆ HPP_STOP_AND_DISPLAY_TIMECOUNTER

#define HPP_STOP_AND_DISPLAY_TIMECOUNTER (   name)
Value:
HPP_DISPLAY_TIMECOUNTER(name)
#define HPP_STOP_TIMECOUNTER(name)
Stop a watch and save elapsed time.
Definition: timer.hh:144

◆ hppBenchmark

#define hppBenchmark (   data)
Value:
do { \
using namespace hpp; \
using namespace ::hpp::debug; \
std::stringstream __ss; \
__ss << data << iendl; \
logging.benchmark.write (__FILE__, __LINE__, __PRETTY_FUNCTION__, \
__ss); \
} while (0)
Definition: assertion.hh:24
HPP_UTIL_DLLAPI std::ostream & iendl(std::ostream &o)
Print an end of line, then set the indentation.
Definition: indent.cc:54

◆ hppDisplayBenchmark

#define hppDisplayBenchmark (   ID)    hppDout (benchmark, #ID << ": "<< _##ID##_timer_.duration ());

◆ hppStartBenchmark

#define hppStartBenchmark (   ID)
Value:
hppDout (benchmark, #ID << ": start"); \
::hpp::debug::Timer _##ID##_timer_ (true)
#define hppDout(channel, data)
Write data to channel when HPP_DEBUG is defined.
Definition: debug.hh:260
Definition: timer.hh:34

◆ hppStopBenchmark

#define hppStopBenchmark (   ID)
Value:
do { \
_##ID##_timer_.stop (); \
hppDout (benchmark, #ID << ": stop"); \
} while (0)