Main Page   Namespace List   Compound List   File List   Namespace Members   Compound Members   File Members  

TNT::Stopwatch Class Reference

#include <tnt_stopwatch.h>

List of all members.

Public Methods

 Stopwatch ()
void start ()
double stop ()
double read ()
void resume ()
int running ()


Detailed Description

Performance Stopwatch used for benchmarking codes. Measures seconds elapsed as a floating point number. Resolution of the clock is determined by CLOCKS_PER_SEC in time.h. Typical use is given by
	Stopwatch Q;

	Q.start;
	{code to benchmark}
	Q.stop;

	double time_elapsed = Q.read();


Constructor & Destructor Documentation

TNT::Stopwatch::Stopwatch ( )
 

Create an instance of a Stopwatch, with its own internal counter.


Member Function Documentation

double TNT::Stopwatch::read ( ) [inline]
 

Read current time, in seconds. (NOTE: Does NOT stop timing.)

void TNT::Stopwatch::resume ( ) [inline]
 

Resume timing, if currently stopped. Operation has no effect if Stopwatch is already running.

int TNT::Stopwatch::running ( ) [inline]
 

Returns:
Zero (0) if stopwatch is not currently running, i.e. stopped. One (1), otherwise.

void TNT::Stopwatch::start ( ) [inline]
 

Start timing from 0.00.

double TNT::Stopwatch::stop ( ) [inline]
 

Stop timing and return elapsed time (in seconds).


The documentation for this class was generated from the following file:
Generated at Thu Jun 26 17:26:25 2003 for Template Numerical Toolkit (TNT) by doxygen1.2.5 written by Dimitri van Heesch, © 1997-2001