glibmm: Glib::Timer Class Reference

Portable stop watch interface. More...

#include <glibmm/timer.h>

Public Member Functions

 Timer ()
 Create a new timer. More...

 
 ~Timer () noexcept
 
 Timer (const Timer&)=delete
 
Timeroperator= (const Timer&)=delete
 
void start ()
 
void stop ()
 
void reset ()
 
double elapsed () const
 Get the elapsed time. More...

 
double elapsed (unsigned long&microseconds) const
 Get the elapsed time. More...

 

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 ( )
noexcept
Glib::Timer::Timer ( const Timer )
delete

Member Function Documentation

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.
Timer& Glib::Timer::operator= ( const Timer )
delete
void Glib::Timer::reset ( )
void Glib::Timer::start ( )
void Glib::Timer::stop ( )