⏱️ golxzn::os::chrono ⏱️ 1.2.4
Chrono for golxzn's projects.
Loading...
Searching...
No Matches
golxzn::os::chrono::clock< BaseClock > Class Template Reference

Class that represents clock.In comparison with golxzn::os::chrono::fast_clock, it provides more functionality but it's slower. More...

#include <clock.hpp>

Public Member Functions

bool running () const noexcept
 Returns true if clock is running.
 
time elapsed () const noexcept
 Returns elapsed time since last reset or construction.
 
time restart () noexcept
 Restarts clock.
 
time reset () noexcept
 Resets clock.
 
void start () noexcept
 Starts clock.
 
void stop () noexcept
 Stops clock.
 

Detailed Description

template<class BaseClock = utils::default_base_clock>
class golxzn::os::chrono::clock< BaseClock >

Class that represents clock.

In comparison with golxzn::os::chrono::fast_clock, it provides more functionality but it's slower.

Template Parameters
BaseClockclock that will be used for measurement. It has to be monotonic and STL compatible.
See also
golxzn::os::chrono::fast_clock

Member Function Documentation

◆ elapsed()

template<class BaseClock = utils::default_base_clock>
time golxzn::os::chrono::clock< BaseClock >::elapsed ( ) const
noexcept

Returns elapsed time since last reset or construction.

Returns
time
See also
time restart() noexcept;
time reset() const noexcept;
bool running() const noexcept

◆ reset()

template<class BaseClock = utils::default_base_clock>
time golxzn::os::chrono::clock< BaseClock >::reset ( )
noexcept

Resets clock.

Returns
elapsed time since last reset or construction.
See also
time restart() const noexcept;
time elapsed() const noexcept;
bool running() const noexcept
void start() noexcept
void stop() noexcept

◆ restart()

template<class BaseClock = utils::default_base_clock>
time golxzn::os::chrono::clock< BaseClock >::restart ( )
noexcept

Restarts clock.

Returns
elapsed time since last reset or construction.
See also
time reset() const noexcept;
time elapsed() const noexcept;
bool running() const noexcept
void start() noexcept
void stop() noexcept

◆ running()

template<class BaseClock = utils::default_base_clock>
bool golxzn::os::chrono::clock< BaseClock >::running ( ) const
noexcept

Returns true if clock is running.

Returns
clock running state
See also
time restart() noexcept;
time reset() const noexcept;
time elapsed() const noexcept;

◆ start()

template<class BaseClock = utils::default_base_clock>
void golxzn::os::chrono::clock< BaseClock >::start ( )
noexcept

Starts clock.

See also
stop()
bool running() const noexcept

◆ stop()

template<class BaseClock = utils::default_base_clock>
void golxzn::os::chrono::clock< BaseClock >::stop ( )
noexcept

Stops clock.

See also
start()
bool running() const noexcept

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