Navigation: Up, Table of Contents, Bibliography, Index, Title Page

A Timer Measuring Real-Time (CGAL_Real_timer)

Definition

A timer t of type CGAL_Real_timer is an object with a state. It is either running or it is stopped. The state is controlled with t.start() and t.stop() . The timer counts the time elapsed since its creation or last reset. It counts only the time where it is in the running state. The time information is given in seconds.

#include <CGAL/Real_timer.h>

Creation

CGAL_Real_timer t;
state is stopped.

Operations

void t.start ()
Precondition: state is stopped.
void t.stop ()
Precondition: state is running.
void t.reset () reset timer to zero. The state is unaffected.
bool t.is_running () true if the current state is running.
double t.time () real time in seconds.
int t.intervals () number of start/stop-intervals since the last reset.
double t.precision () smallest possible time step in seconds.
double t.max () maximal representable time in seconds.

Implementation

The timer class is based in the C function gettimeofday(...).


Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The CGAL Project. 22 January 1999.