mace::Stopwatch Class Reference

#include <Stopwatch.h>

List of all members.


Detailed Description

used to measure cumulative time.

Common usage 1 (start and stop around timed work):

 mace::Stopwatch s;
 
 s.start();
 doSomeWork();
 s.stop();
 
 unrelatedWork();

 s.start();
 doSomeWork();
 s.stop();

 cout << "Time: " << s.getCumulativeTime();

Common usage 2 (when not sure whether to count iteration):

 mace::Stopwatch s;
 
 do {
   s.start();
   doSomeWork();
   s.mark();
   if (workWasInteresting()) {
     s.confirm();
   }
 } while (notDone());

 cout << "Time: " << s.getCumulativeTime();

Definition at line 79 of file Stopwatch.h.


Public Member Functions

void start ()
 set the start time
void mark ()
 set a potential stop time
void confirm ()
 accumulate markTime - startTime on the watch
void stop ()
 mark(), then confirm()
uint64_t getCumulativeTime ()
 return the cumulative of the time

The documentation for this class was generated from the following file:

Generated on Sat Oct 4 21:30:43 2008 for Mace Library by  doxygen 1.5.5