Effective implementation of algorithms (Master Thesis)
Effective and error-free implementation of algorithms
utils::timer::Timer Class Reference

#include <timer.h>

List of all members.

Public Member Functions

 Timer ()
void reset ()
double elapsed_time_sec ()

Private Attributes

clock_t start_time

Detailed Description

Basic measurement of time intervals

Usage:

  Timer t;
  hard_work();
  cout << t.get_elapsed_time();
  t.reset();
  hard_work();
  cout << t.get_elapsed_time();
 
Warning:
On some systems long times may be wrapped!

Constructor & Destructor Documentation

utils::timer::Timer::Timer ( ) [inline]

Construct the Timer, the time is measured from this moment

Exceptions:
std::runtime_erroron failure

Member Function Documentation

double utils::timer::Timer::elapsed_time_sec ( ) [inline]

Returns elapsed time since last reset()

Warning:
on sime systems long times may get wrapped
Returns:
elapsed time in seconds
Exceptions:
std::runtime_erroron failure
void utils::timer::Timer::reset ( ) [inline]

Reset the timer. Measure time from this instant.

Exceptions:
std::runtime_erroron failure

Member Data Documentation

Last time of the reset


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines