HephAudio
v3.0.6
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
Loading...
Searching...
No Matches
HephCommon
HeaderFiles
Stopwatch.h
Go to the documentation of this file.
1
#pragma once
2
#include "
HephShared.h
"
3
#include <chrono>
4
7
#define HEPH_SW_NANO (1e-9)
8
#define HEPH_SW_MICRO (1e-6)
9
#define HEPH_SW_MILLI (1e-3)
10
15
#define HEPH_SW_RESET Heph::Stopwatch::GetInstance().Reset()
16
22
#define HEPH_SW_DT Heph::Stopwatch::GetInstance().DeltaTime()
23
28
#define HEPH_SW_DT_S Heph::Stopwatch::GetInstance().DeltaTime()
29
34
#define HEPH_SW_DT_MS Heph::Stopwatch::GetInstance().DeltaTime(HEPH_SW_MILLI)
35
40
#define HEPH_SW_DT_US Heph::Stopwatch::GetInstance().DeltaTime(HEPH_SW_MICRO)
41
46
#define HEPH_SW_DT_NS Heph::Stopwatch::GetInstance().DeltaTime(HEPH_SW_NANO)
47
48
namespace
Heph
49
{
54
class
HEPH_API
Stopwatch
final
55
{
56
private
:
57
std::chrono::steady_clock::time_point tp;
58
59
public
:
61
Stopwatch
();
62
67
void
Reset
();
68
73
double
DeltaTime
()
const
;
74
80
double
DeltaTime
(
double
prefix)
const
;
81
86
static
Stopwatch
&
GetInstance
() noexcept;
87
};
88
}
HephShared.h
HEPH_API
#define HEPH_API
Definition
HephShared.h:132
Heph::Stopwatch
class for measuring time.
Definition
Stopwatch.h:55
Heph::Stopwatch::Reset
void Reset()
Heph::Stopwatch::DeltaTime
double DeltaTime(double prefix) const
Heph::Stopwatch::GetInstance
static Stopwatch & GetInstance() noexcept
gets the instance that's local to the current thread.
Heph::Stopwatch::DeltaTime
double DeltaTime() const
Heph::Stopwatch::Stopwatch
Stopwatch()
Generated by
1.11.0