ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
Loading...
Searching...
No Matches
Timer Class Reference

#include <Timer.h>

Public Member Functions

void start ()
 
void stop ()
 
bool isRunning () const
 
void reset ()
 
template<typename Precision >
double getElapsedTime ()
 

Private Attributes

std::chrono::time_point< std::chrono::high_resolution_clock > t1
 
std::chrono::time_point< std::chrono::high_resolution_clock > t2
 
bool running {false}
 

Detailed Description

Definition at line 15 of file Timer.h.

Member Function Documentation

◆ getElapsedTime()

template<typename Precision >
double Timer::getElapsedTime ( )
inline

Definition at line 31 of file Timer.h.

◆ isRunning()

bool Timer::isRunning ( ) const

Definition at line 17 of file Timer.cpp.

◆ reset()

void Timer::reset ( )

Definition at line 22 of file Timer.cpp.

◆ start()

void Timer::start ( )

Definition at line 4 of file Timer.cpp.

◆ stop()

void Timer::stop ( )

Definition at line 11 of file Timer.cpp.

Member Data Documentation

◆ running

bool Timer::running {false}
private

Definition at line 50 of file Timer.h.

◆ t1

std::chrono::time_point<std::chrono::high_resolution_clock> Timer::t1
private
Initial value:
{
std::chrono::high_resolution_clock::now()}

Definition at line 46 of file Timer.h.

◆ t2

std::chrono::time_point<std::chrono::high_resolution_clock> Timer::t2
private
Initial value:
{
std::chrono::high_resolution_clock::now()}

Definition at line 48 of file Timer.h.


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