glibmm  2.62.0
About: glibmm is a set of C++ bindings for glib, including cross-platform APIs such as a std::string-like UTF8 string class, string utility methods, such as a text encoding converter API, file access, and threads.
  Fossies Dox: glibmm-2.62.0.tar.xz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

Glib::Timer Class Reference

Portable stop watch interface. More...

#include <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...

Private Attributes


Detailed Description

Portable stop watch interface.

This resembles a convient and portable timer with microseconds resolution.

Definition at line 32 of file timer.h.

Constructor & Destructor Documentation

◆ Timer() [1/2]

Glib::Timer::Timer ( )

Create a new timer.

Also starts timing by calling start() implicitly.

Definition at line 25 of file

◆ ~Timer()

Glib::Timer::~Timer ( )

Definition at line 29 of file

References gobject_.

◆ Timer() [2/2]

Glib::Timer::Timer ( const Timer )

Member Function Documentation

◆ elapsed() [1/2]

double Glib::Timer::elapsed ( ) const

Get the elapsed time.

The value in seconds.

Definition at line 53 of file

References gobject_.

◆ elapsed() [2/2]

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

Get the elapsed time.

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

Definition at line 59 of file

References gobject_.

◆ operator=()

Timer& Glib::Timer::operator= ( const Timer )

◆ reset()

void Glib::Timer::reset ( )

Definition at line 47 of file

References gobject_.

◆ start()

void Glib::Timer::start ( )

Definition at line 35 of file

References gobject_.

◆ stop()

void Glib::Timer::stop ( )

Definition at line 41 of file

References gobject_.

Member Data Documentation

◆ gobject_

GTimer* Glib::Timer::gobject_

Definition at line 66 of file timer.h.

Referenced by elapsed(), reset(), start(), stop(), and ~Timer().

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