idol
A C++ Framework for Optimization
Loading...
Searching...
No Matches
idol::Timer Class Reference

#include <Timer.h>

Collaboration diagram for idol::Timer:
Collaboration graph

Public Types

enum  Unit { Seconds , Milliseconds , Microseconds }
 

Public Member Functions

void start ()
 
void stop ()
 
double count (Unit t_unit=Seconds) const
 
double cumulative_count (Unit t_unit=Seconds) const
 
double factor (Unit t_unit) const
 

Detailed Description

This class is used to measure the time it takes for a certain operation to complete.

Definition at line 17 of file Timer.h.

Member Enumeration Documentation

◆ Unit

enum idol::Timer::Unit

Definition at line 27 of file Timer.h.

Member Function Documentation

◆ count()

double idol::Timer::count ( Unit  t_unit = Seconds) const

Returns the time elapsed since the timer was started.

Parameters
t_unitthe unit of time to return the elapsed time in.
Returns
the time elapsed since the timer was started.

◆ cumulative_count()

double idol::Timer::cumulative_count ( Unit  t_unit = Seconds) const

Returns the cumulative elapsed time

Parameters
t_unitthe unit of time to return the elapsed time in.
Returns
the cumulative elapsed time

◆ start()

void idol::Timer::start ( )

Starts the timer.

◆ stop()

void idol::Timer::stop ( )

Stops the timer.