Loading...
Searching...
No Matches
idol::Timer Class Reference

#include <Timer.h>

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.

Public Types

enum  Unit { Seconds , Milliseconds , Microseconds }

Public Methods

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

Member Enumeration Documentation

◆ Unit

enum idol::Timer::Unit

Definition at line 27 of file Timer.h.

Methods Documentation

◆ count()

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

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
nodiscard

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.