Pacman Torben Petré
Loading...
Searching...
No Matches
logic::Stopwatch Class Reference

#include <Stopwatch.h>

Public Member Functions

 Stopwatch (Stopwatch &other)=delete
void operator= (const Stopwatch &)=delete
double getDeltaTime () const
 Returns the deltatime, updated by Stopwatch::tick.
void tick ()
 Updates deltatime to hold the time difference between now and the last tick.
void reset ()
 Resets the Stopwatch.

Static Public Member Functions

static StopwatchgetInstance ()
 Returns an instance of the Stopwatch class.

Constructor & Destructor Documentation

◆ Stopwatch()

logic::Stopwatch::Stopwatch ( Stopwatch & other)
delete

Singletons should not be cloneable or assignable.

Member Function Documentation

◆ getDeltaTime()

double Stopwatch::getDeltaTime ( ) const
nodiscard

Returns the deltatime, updated by Stopwatch::tick.

Returns
Deltatime

◆ getInstance()

Stopwatch & Stopwatch::getInstance ( )
staticnodiscard

Returns an instance of the Stopwatch class.

Returns
Stopwatch instance

◆ operator=()

void logic::Stopwatch::operator= ( const Stopwatch & )
delete

◆ reset()

void Stopwatch::reset ( )

Resets the Stopwatch.

◆ tick()

void Stopwatch::tick ( )

Updates deltatime to hold the time difference between now and the last tick.


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