Main Page Widgets glibmm Namespaces Book

# Glib::Timer Class Reference

Portable stop watch interface. More...

List of all members.

## Public Member Functions
| Timer ()
| Create a new timer.
| ~Timer ()
void | start ()
void | stop ()
void | reset ()
double | elapsed () const
| Get the elapsed time.
double | elapsed (unsigned long& microseconds) const
| Get the elapsed time.

## Detailed Description

Portable stop watch interface.

This resembles a convient and portable timer with microseconds resolution.

## Constructor & Destructor Documentation

Glib::Timer::Timer | ( |  | ) |

Create a new timer.

Also starts timing by calling start() implicitly.

Glib::Timer::~Timer | ( |  | ) |

## Member Function Documentation

void Glib::Timer::start | ( |  | ) |

void Glib::Timer::stop | ( |  | ) |

void Glib::Timer::reset | ( |  | ) |

double Glib::Timer::elapsed | ( |  | ) | const

Get the elapsed time.

Returns:
  The value in seconds.

double Glib::Timer::elapsed | ( | unsigned long & | microseconds | ) | const

Get the elapsed time.

Returns:
  The value in seconds. Also fills `microseconds` with the corresponding µs value.

The documentation for this class was generated from the following file:

- timer.h