next up previous contents
Next: What's new in WARPED Up: Utility classes Previous: The SimpleStack class

The Stopwatch class

The stop watch is started and stopped by calling start() and stop(). Once the watch has been started, elapsed() returns (as a double) the amount of real time, in seconds, which elapsed between the start() and stop() calls. If the watch has been started but not stopped, the amount of elapsed time since start() is returned (without stopping the watch).

This class is set up so that when compiling under solaris, it will use calls to gethrtime to provide extremely accurate timing. Under other operating systems, gettimeofday() is used.



Philip A. Wilsey
1/26/1998