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

GTimergobject_
 

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.cc.

◆ ~Timer()

Glib::Timer::~Timer ( )
noexcept

Definition at line 29 of file timer.cc.

References gobject_.

◆ Timer() [2/2]

Glib::Timer::Timer ( const Timer )
delete

Member Function Documentation

◆ elapsed() [1/2]

double Glib::Timer::elapsed ( ) const

Get the elapsed time.

Returns
The value in seconds.

Definition at line 53 of file timer.cc.

References gobject_.

◆ elapsed() [2/2]

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.

Definition at line 59 of file timer.cc.

References gobject_.

◆ operator=()

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

◆ reset()

void Glib::Timer::reset ( )

Definition at line 47 of file timer.cc.

References gobject_.

◆ start()

void Glib::Timer::start ( )

Definition at line 35 of file timer.cc.

References gobject_.

◆ stop()

void Glib::Timer::stop ( )

Definition at line 41 of file timer.cc.

References gobject_.

Member Data Documentation

◆ gobject_

GTimer* Glib::Timer::gobject_
private

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: