STXXL  1.4-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stxxl::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 170 of file timer.h.

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

stxxl::fake_timer::fake_timer ( bool  = false)
inline

initialize and optionally immediately start the timer

Definition at line 177 of file timer.h.

Member Function Documentation

double stxxl::fake_timer::mseconds ( ) const
inline

return currently accumulated time in milliseconds

Definition at line 193 of file timer.h.

fake_timer& stxxl::fake_timer::operator+= ( const fake_timer )
inline

accumulate elapsed time from another timer

Definition at line 211 of file timer.h.

void stxxl::fake_timer::reset ( )
inline

return accumulated time

Definition at line 189 of file timer.h.

double stxxl::fake_timer::seconds ( ) const
inline

return currently accumulated time in seconds (as double)

Definition at line 205 of file timer.h.

void stxxl::fake_timer::start ( )
inline

start timer

Definition at line 181 of file timer.h.

void stxxl::fake_timer::stop ( )
inline

stop timer

Definition at line 185 of file timer.h.

double stxxl::fake_timer::useconds ( ) const
inline

return currently accumulated time in microseconds

Definition at line 199 of file timer.h.

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 217 of file timer.h.

Member Data Documentation

const bool stxxl::fake_timer::is_real = false
static

boolean indicating that this class does NOT do real timing

Definition at line 174 of file timer.h.


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