QuasarEngine
Cross-platform 3D engine and editor
Toggle main menu visibility
Loading...
Searching...
No Matches
ScopedTimer.h
Go to the documentation of this file.
1
#pragma once
2
7
8
#include <
quasar/core/Base.h
>
9
#include <
quasar/core/Timer.h
>
10
11
#include <string>
12
13
namespace
Quasar
14
{
26
class
ScopedTimer
27
{
28
public
:
31
explicit
ScopedTimer
(std::string name);
32
34
~ScopedTimer
();
35
36
ScopedTimer
(
const
ScopedTimer
&) =
delete
;
37
ScopedTimer
& operator=(
const
ScopedTimer
&) =
delete
;
38
ScopedTimer
(
ScopedTimer
&&) =
delete
;
39
ScopedTimer
& operator=(
ScopedTimer
&&) =
delete
;
40
41
private
:
42
std::string m_Name;
43
Timer
m_Timer;
44
};
45
}
46
56
#ifdef QUASAR_DEBUG
57
#define QUASAR_SCOPED_TIMER(name) const ::Quasar::ScopedTimer QUASAR_CONCAT(scopedTimer, __LINE__)(name)
58
#else
59
#define QUASAR_SCOPED_TIMER(name) \
60
do \
61
{ \
62
if constexpr (false) \
63
{ \
64
static_cast<void>(::Quasar::ScopedTimer(name)); \
65
} \
66
} while (false)
67
#endif
Base.h
Contains the base definitions and utilities for the Quasar engine.
Timer.h
A high-resolution (steady) timer for measuring elapsed time.
Quasar::ScopedTimer::~ScopedTimer
~ScopedTimer()
Logs the name and the time elapsed since the creation, in milliseconds.
Quasar::ScopedTimer::ScopedTimer
ScopedTimer(std::string name)
Starts measuring right away.
Quasar::Timer
High-resolution (steady) timer that measures the time elapsed since it was created or last reset.
Definition
Timer.h:19
Quasar
Contains all the engine code.
quasar
core
ScopedTimer.h
Generated by
1.18.0