The Vish Visualization Shell 0.3
Vish
MemCore::Timer Class Reference

A class to hide system dependent methods to count seconds. More...

#include <elementary/memcore/Timer.hpp>

Inheritance diagram for MemCore::Timer:
MemCore::Profiler

Public Member Functions

double µsecs () const noexcept
 microseconds elapsed since timer start
auto elapsed () const noexcept
 Get time elapsed since the Timer was constructed.
double get_secs_and_restart () noexcept
 return seconds elapsed since timer start and restart the timer
double microsecs () const noexcept
 microseconds elapsed since timer start
double millisecs () const noexcept
 milliseconds elapsed since timer start
double msecs () const noexcept
 milliseconds elapsed since timer start
double secs () const noexcept
 seconds elapsed since timer start

Static Public Member Functions

static void sleep (double seconds)
 Sleep a certain number of seconds.

Detailed Description

A class to hide system dependent methods to count seconds.

Member Function Documentation

◆ elapsed()

auto MemCore::Timer::elapsed ( ) const
inlinenoexcept

Get time elapsed since the Timer was constructed.

Use std::duration_cast<std::chrono::microseconds> to convert it into microseconds, or whatever other unit may be desireable.

See also
https://en.cppreference.com/w/cpp/chrono/duration/duration_cast