timer Class Reference

#include <timer.h>


Detailed Description

Provide an interface for timing execution using gettimeofday().

Todo:
This should probably be replaced with timer2, since clock() is defined in the ANSI standard.

Definition at line 44 of file timer.h.


Public Member Functions

 timer ()
int reset ()
 Set time 'zero'.
int set ()
 Store the present time.
double seconds_elapsed ()
 Return the number of seconds between set() and reset().
int time_elapsed (int &d, int &h, int &m, int &s, int &usec)
 Return the time between set() and reset().
int time_remaining (int n, int ntot, int &d, int &h, int &m, int &s, int &usec)
 Time remaining if n out of tot tasks have been completed.
std::string time_remaining (int n, int ntot)
 Time remaining if n out of tot tasks have been completed.
std::string interval_to_string (int d, int h, int m, int s, int usec)
 Convert a time interval to a string.

Protected Attributes

struct timeval zero
 The last time the clock was reset.
struct timeval mark
 The most resent time from set().
struct timezone tz
 The timezone.

The documentation for this class was generated from the following file:
Locations of visitors to this page Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.