Public Member Functions

Timer Class Reference

#include <Timer.h>

List of all members.

Public Member Functions

 Timer ()
 Timer (const Timer &other)
 ~Timer ()
void clear ()
 Empties out all recorded timings so far AND sets last_time to now.
void fast_forward ()
 Skips ahead and sets last time to now.
void record (const std::string &name)
 Records time since start or last call to record.
Timeroperator+= (const Timer &other)
 Appends timings from another timer to those for this one.
timing_t start_time () const
 Returns when the timer was initially constructed.
void write (std::ostream &out=std::cout, bool print_total=false) const
 Prints all timings (nicely formatted, in sec) to a file.
void dump (std::ostream &out=std::cout, bool print_total=false)
 Writes AND clears.
timing_t operator[] (const std::string &name) const
 Returns the i-th timing recorded (starting with 0)
Timeroperator= (const Timer &other)

Detailed Description

Definition at line 11 of file Timer.h.


Constructor & Destructor Documentation

Timer (  )

Definition at line 12 of file Timer.cpp.

Timer ( const Timer other )

Definition at line 15 of file Timer.cpp.

~Timer (  )

Definition at line 32 of file Timer.cpp.


Member Function Documentation

void clear (  )

Empties out all recorded timings so far AND sets last_time to now.

Definition at line 35 of file Timer.cpp.

void dump ( std::ostream &  out = std::cout,
bool  print_total = false 
) [inline]

Writes AND clears.

Definition at line 51 of file Timer.h.

void fast_forward (  )

Skips ahead and sets last time to now.

Definition at line 43 of file Timer.cpp.

Timer & operator+= ( const Timer other )

Appends timings from another timer to those for this one.

Also updates last according to that of other timer.

Definition at line 62 of file Timer.cpp.

Timer & operator= ( const Timer other )

Definition at line 23 of file Timer.cpp.

timing_t operator[] ( const std::string &  name ) const [inline]

Returns the i-th timing recorded (starting with 0)

Definition at line 57 of file Timer.h.

void record ( const std::string &  name )

Records time since start or last call to record.

timing_t start_time (  ) const [inline]

Returns when the timer was initially constructed.

Definition at line 45 of file Timer.h.

void write ( std::ostream &  out = std::cout,
bool  print_total = false 
) const

Prints all timings (nicely formatted, in sec) to a file.

Definition at line 74 of file Timer.cpp.


The documentation for this class was generated from the following files:
Muster. Copyright © 2010, Lawrence Livermore National Laboratory, LLNL-CODE-433662.
Distribution of Muster and its documentation is subject to terms of the Muster LICENSE.
Generated on Mon Dec 20 2010 using Doxygen 1.7.2