QuasarEngine
Cross-platform 3D engine and editor
Toggle main menu visibility
Loading...
Searching...
No Matches
Timer.h
Go to the documentation of this file.
1
#pragma once
2
7
8
#include <chrono>
9
10
namespace
Quasar
11
{
17
18
class
Timer
19
{
20
public
:
25
using
Clock
= std::chrono::steady_clock;
26
28
Timer
() {
Reset
(); }
29
31
void
Reset
();
32
35
double
ElapsedSeconds
()
const
;
36
39
double
ElapsedMilliseconds
()
const
;
40
41
private
:
42
Clock::time_point m_Start;
43
};
44
}
Quasar::Timer::ElapsedSeconds
double ElapsedSeconds() const
Returns the time elapsed since the timer was created or last reset, in seconds.
Quasar::Timer::Timer
Timer()
Creates a timer that starts measuring right away.
Definition
Timer.h:28
Quasar::Timer::Clock
std::chrono::steady_clock Clock
Clock used by the timer, monotonic with nanosecond resolution.
Definition
Timer.h:25
Quasar::Timer::Reset
void Reset()
Resets the timer to zero.
Quasar::Timer::ElapsedMilliseconds
double ElapsedMilliseconds() const
Returns the time elapsed since the timer was created or last reset, in milliseconds.
Quasar
Contains all the engine code.
quasar
core
Timer.h
Generated by
1.18.0