libabigail
Public Types | Public Member Functions | List of all members
timer Class Reference

A type used to time various part of the libabigail system. More...

#include <abg-tools-utils.h>

Public Types

enum  kind { DEFAULT_TIMER_KIND , START_ON_INSTANTIATION_TIMER_KIND }
 

Public Member Functions

 timer (kind k=DEFAULT_TIMER_KIND)
 Constructor of the timer type. More...
 
 ~timer ()
 Destructor of the timer type. More...
 
bool start ()
 Start the timer. More...
 
bool stop ()
 Stop the timer. More...
 
bool value (time_t &hours, time_t &minutes, time_t &seconds, time_t &milliseconds) const
 Get the elapsed time in hour:minutes:seconds:milliseconds. More...
 
string value_as_string () const
 Get the elapsed time as a human-readable string. More...
 
time_t value_in_seconds () const
 Get the elapsed time in seconds. More...
 

Detailed Description

A type used to time various part of the libabigail system.

Definition at line 292 of file abg-tools-utils.h.

Member Enumeration Documentation

◆ kind

enum kind
Enumerator
DEFAULT_TIMER_KIND 

Default timer kind.

START_ON_INSTANTIATION_TIMER_KIND 

This kind of timer starts upon instantiation.

Definition at line 298 of file abg-tools-utils.h.

Constructor & Destructor Documentation

◆ timer()

Constructor of the timer type.

Parameters
kthe kind of timer to instantiate.

Definition at line 214 of file abg-tools-utils.cc.

◆ ~timer()

~timer ( )

Destructor of the timer type.

Definition at line 322 of file abg-tools-utils.cc.

Member Function Documentation

◆ start()

bool start ( )

Start the timer.

To stop the timer (and record the time elapsed since the timer was started), call the timer::stop member function.

Returns
true upon successful completion.

Definition at line 228 of file abg-tools-utils.cc.

◆ stop()

bool stop ( )

Stop the timer.

This records the time elapsed since the timer was started using the timer::start member function.

Returns
true upon successful completion.

Definition at line 242 of file abg-tools-utils.cc.

◆ value()

bool value ( time_t &  hours,
time_t &  minutes,
time_t &  seconds,
time_t &  milliseconds 
) const

Get the elapsed time in hour:minutes:seconds:milliseconds.

Parameters
hoursout parameter. This is set to the number of hours elapsed.
minutesout parameter. This is set to the number of minutes (passed the number of hours) elapsed.
secondsout parameter. This is se to the number of seconds (passed the number of hours and minutes) elapsed.
milliseconds.This is set ot the number of milliseconds (passed the number of hours, minutes and seconds) elapsed.
Returns
true upon successful completion.

Definition at line 272 of file abg-tools-utils.cc.

◆ value_as_string()

string value_as_string ( ) const

Get the elapsed time as a human-readable string.

Returns
the elapsed time as a human-readable string.

Definition at line 298 of file abg-tools-utils.cc.

◆ value_in_seconds()

time_t value_in_seconds ( ) const

Get the elapsed time in seconds.

Returns
the time elapsed between the invocation of the methods timer::start() and timer::stop, in seconds.

Definition at line 254 of file abg-tools-utils.cc.


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