RUSH
Reusable Utilities in Single Headers is a collection of header-only utilities for C++
Loading...
Searching...
No Matches
rush::chrono::Chrono< T > Class Template Reference

A simple chrono class to measure elapsed time. More...

#include <chrono.hpp>

Public Member Functions

 Chrono (const Chrono &)=delete
 
 Chrono (Chrono &&) noexcept=delete
 
Chronooperator= (const Chrono &)=delete
 
Chronooperator= (Chrono &&other) noexcept=delete
 
void tic ()
 Reset the chrono timer.
 
double toc () const
 Get elapsed time since last tic.
 
std::string unit () const
 Get unit as string.
 

Detailed Description

template<typename T = s>
class rush::chrono::Chrono< T >

A simple chrono class to measure elapsed time.

Template Parameters
TUnit of time (default to seconds).

Member Function Documentation

◆ toc()

template<typename T = s>
double rush::chrono::Chrono< T >::toc ( ) const
inlinenodiscard

Get elapsed time since last tic.

Returns
Elapsed time in the specified unit.

◆ unit()

template<typename T = s>
std::string rush::chrono::Chrono< T >::unit ( ) const
inlinenodiscard

Get unit as string.

Returns
Chrono unit as string.

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