Reference Manual
Inti Logo
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

Inti::G::Timer Class Reference

A GTimer C++ wrapper interface. More...

#include <inti/glib/timer.h>

Inheritance diagram for Inti::G::Timer:

Inti::ReferencedObject Inti::ReferencedBase List of all members.

Public Member Functions

Constructors
Accessors
Methods

Detailed Description

A GTimer C++ wrapper interface.

Timer records a start time, and counts microseconds elapsed since that time. This is done somewhat differently on different platforms, and can be tricky to get exactly right, so Timer provides a portable and convenient interface.

There is not much you can do with a timer. You can construct it, start() it running, stop() it running, and reset() it to zero.


Member Function Documentation

double Inti::G::Timer::elapsed unsigned long *  microseconds = 0  ) 
 

Obtains the elapsed time.

Parameters:
microseconds The fractional part of seconds elapsed, in microseconds, or null.
Returns:
The seconds elapsed as a floating point value, including any fractional part.

If a timer has been started but not stopped this method obtains the time since the timer was started. If timer has been stopped it obtains the elapsed time between the time it was started and the time it was stopped. The return value is the number of seconds elapsed, including any fractional part. If microseconds is non-null, it will be set to the microseconds fraction of the elapsed time. It does not contain the seconds. The microseconds out parameter is not very useful.

void Inti::G::Timer::reset  ) 
 

Reset an already started timer to zero.

It's fine to call start() on an already-started timer to reset the start time, so reset() serves no real purpose, other than to make the intentions of your code a bit clearer.

void Inti::G::Timer::start  ) 
 

Marks a start time, so that future calls to elapsed() will report the time since start() was called.

When you construct a new timer this method automatically marks the start time, so there is no need to call start() immediately after constructing the timer.


The documentation for this class was generated from the following file: Main Page - Footer


Generated on Sun Sep 14 20:08:09 2003 for Inti by doxygen 1.3.2 written by Dimitri van Heesch, © 1997-2002