ScopedTimer Class Reference
[Scoped]

#include <ScopedTimer.h>

List of all members.


Detailed Description

accumulate object lifetime into a variable

Stores the start time in the constructor, and accumulates the destructor time - start time into the time passed into the constructor. The enabled constructor flag allows for easy disabling of the timer without removing it from the code.

Todo:
James, do you think this should be in the mace namespace?

Definition at line 26 of file ScopedTimer.h.


Public Member Functions

 ScopedTimer (uint64_t &t, bool enabled=true)
 constructor. creates object.
 ~ScopedTimer ()
 on destruction, if enabled, adds the current time - start time to time from contructor.

Constructor & Destructor Documentation

ScopedTimer::ScopedTimer ( uint64_t &  t,
bool  enabled = true 
) [inline]

constructor. creates object.

if enabled, stores the start time in a variable for adding it to t later.

Parameters:
t reference to uint64_t to add the lifespan of this object to
enabled if false the timer does nothing

Definition at line 36 of file ScopedTimer.h.


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

Generated on Sat Oct 4 21:30:30 2008 for Mace Library by  doxygen 1.5.5