Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

Timer Class Reference

#include <timer.h>

List of all members.


Public Methods

  Timer (void)
  default constructor.

void  start (void)
  Start the timer.

void  stop (void)
  Stop the timer.

void  reset (void)
  Reset the timer.

void  set (double secs)
  Set the timer.

  operator double (void)
  Return the number of seconds elapsed.


Private Attributes

long  _starttime
  The _timer variable will be different depending on the OS. We try to use the best timer available.

long  _elapsedtime
  The _timer variable will be different depending on the OS. We try to use the best timer available.


Detailed Description

USAGE:

Timer t;

t.start(); do hairy computation 1. t.stop();

cout << "The first hairy computation took " << (double) t << " seconds." << endl;

t.reset();

t.start(); do hairy computation 2. t.stop();

cout << "The second hairy computation took " << (double) t << " seconds." << endl;

Definition at line 81 of file timer.h.


The documentation for this class was generated from the following file:
Generated at Wed Nov 7 16:26:00 2001 for Optimization by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001