Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fake_timer Class Reference

Detailed Description

Class fake_timer is a drop-in replacement for timer, which does nothing.

Using the fake class, timers can quickly be disabled in release builds, but still be available for debugging session.

See Also
timer

Definition at line 167 of file timer.hpp.

#include <timer.hpp>

Public Member Functions

 fake_timer (bool=false)
 initialize and optionally immediately start the timer More...
 
double mseconds () const
 return currently accumulated time in milliseconds More...
 
fake_timeroperator+= (const fake_timer &)
 accumulate elapsed time from another timer More...
 
void reset ()
 return accumulated time More...
 
double seconds () const
 return currently accumulated time in seconds (as double) More...
 
void start ()
 start timer More...
 
void stop ()
 stop timer More...
 
double useconds () const
 return currently accumulated time in microseconds More...
 

Static Public Attributes

static const bool is_real = false
 boolean indicating that this class does NOT do real timing More...
 

Friends

std::ostream & operator<< (std::ostream &os, const fake_timer &t)
 direct <<-operator for ostream. Can be used for printing with std::cout. More...
 

Constructor & Destructor Documentation

fake_timer ( bool  = false)
inlineexplicit

initialize and optionally immediately start the timer

Definition at line 174 of file timer.hpp.

Member Function Documentation

double mseconds ( ) const
inline

return currently accumulated time in milliseconds

Definition at line 190 of file timer.hpp.

fake_timer& operator+= ( const fake_timer )
inline

accumulate elapsed time from another timer

Definition at line 208 of file timer.hpp.

void reset ( )
inline

return accumulated time

Definition at line 186 of file timer.hpp.

double seconds ( ) const
inline

return currently accumulated time in seconds (as double)

Definition at line 202 of file timer.hpp.

void start ( )
inline

start timer

Definition at line 178 of file timer.hpp.

void stop ( )
inline

stop timer

Definition at line 182 of file timer.hpp.

double useconds ( ) const
inline

return currently accumulated time in microseconds

Definition at line 196 of file timer.hpp.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const fake_timer t 
)
friend

direct <<-operator for ostream. Can be used for printing with std::cout.

Definition at line 214 of file timer.hpp.

Member Data Documentation

const bool is_real = false
static

boolean indicating that this class does NOT do real timing

Definition at line 171 of file timer.hpp.


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