timer_gettod Class Reference

#include <timer.h>


Detailed Description

Provide an interface for timing execution using gettimeofday().

Todo:
Better testing which doesn't use a fixed number of mathematical operations, but automatically selects enough operations.

Definition at line 44 of file timer.h.


Public Member Functions

 timer_gettod ()
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:

Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.

Project hosting provided by SourceForge.net Logo, O2scl Sourceforge Project Page