Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Essential Tools Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWClockTimer

Module:  Essential Tools Module   Group:  Miscellaneous Classes


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().

Persistence

None

Example

This example prints out the amount of time used:

Program output:

The program output is a number less than 5 since RWTime has only second accuracy (milliseconds are truncated) while RWClockTimer has millisecond accuracy. (RWTime is deprecated. For millisecond accuracy, use RWDateTime.

Public Constructor

RWClockTimer();

Public Member Functions

rwint64 
elapsedSeconds() const;
rwint64 
elapsedMilliseconds() const;
rwint64 
elapsedMicroseconds() const;
double
elapsedTime() const;
void
reset();
void
start();
void
stop();


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, 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.