Muster
 All Classes Namespaces Files Functions Variables Typedefs Macros
Timer Class Reference

#include <Timer.h>

Public Member Functions

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

Definition at line 48 of file Timer.cpp.

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 Thu Sep 1 2016 using Doxygen 1.8.5