Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Essential Tools Module Reference Guide

RWClockTimer

Module:  Essential Tools Module   Group:  Miscellaneous


Does not inherit

Local Index

Members

Synopsis

#include <rw/timer.h>
RWClockTimer timer;

Description

This class measures elapsed wall clock time. The timer has two states: running and stopped. The timer measures the total amount of time spent in the "running" state since it was either constructed or reset. RWClockTimer has the same interface as RWTimer.

The timer is put into the "running" state by calling member function start(). It is put into the "stopped" state by calling stop().

RWClockTimer uses the RWDateTime class to get times with millisecond accuracy, and can thus measure times within the full range of the RWDateTime class.

Persistence

None

Example

This example prints out the amount of time used:

The program output will be a number less than 5 since RWTime only has second accuracy (milliseconds are truncated) while RWClockTimer has millisecond accuracy.

Public Constructor

RWTimer();

Public Member Functions

double
elapsedTime() const;
void
reset();
void
start();
void
stop();


Previous fileTop of DocumentContentsIndex pageNext file

©2004 Copyright Quovadx, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.