MGL(Win32)
読み取り中…
検索中…
一致する文字列を見つけられません
mgl_chrono_elapsed_timer.h
[詳解]
1// SPDX-License-Identifier: Zlib
2/* ------------------------------------------------------------------------- */
9/* ------------------------------------------------------------------------- */
10
11#ifndef INCGUARD_MGL_CHRONO_ELAPSED_TIMER_H_1614115660
12#define INCGUARD_MGL_CHRONO_ELAPSED_TIMER_H_1614115660
13
15
16namespace MGL::System
17{
20{
21public:
22 ElapsedTimer() noexcept;
23 ElapsedTimer(TickTime tickTime) noexcept;
24
25 void Lap() noexcept;
26
27 /* ------------------------------------------------------------------------- */
32 /* ------------------------------------------------------------------------- */
33 [[nodiscard]] constexpr float GetLappedTimeMillisecond() const noexcept
34 {
35 return _lappedTimeNanosecond / 1000.0f / 1000.0f;
36 }
37
38 /* ------------------------------------------------------------------------- */
43 /* ------------------------------------------------------------------------- */
44 [[nodiscard]] constexpr float GetLappedTimeMicrosecond() const noexcept
45 {
46 return _lappedTimeNanosecond / 1000.0f;
47 }
48
49 /* ------------------------------------------------------------------------- */
54 /* ------------------------------------------------------------------------- */
55 [[nodiscard]] constexpr float GetLappedTimeNanosecond() const noexcept
56 {
57 return _lappedTimeNanosecond;
58 }
59
60private:
61 TickTime _tick;
62 float _lappedTimeNanosecond;
63};
64} // namespace MGL::System
65
66#endif // INCGUARD_MGL_CHRONO_ELAPSED_TIMER_H_1614115660
67
68// vim: et ts=4 sw=4 sts=4
経過タイマークラス
Definition mgl_chrono_elapsed_timer.h:20
ElapsedTimer() noexcept
コンストラクタ
Definition mgl_chrono_elapsed_timer.cc:20
constexpr float GetLappedTimeNanosecond() const noexcept
測定された時間をナノ秒で取得
Definition mgl_chrono_elapsed_timer.h:55
constexpr float GetLappedTimeMicrosecond() const noexcept
測定された時間をマイクロ秒で取得
Definition mgl_chrono_elapsed_timer.h:44
void Lap() noexcept
測定時間を更新
Definition mgl_chrono_elapsed_timer.cc:48
constexpr float GetLappedTimeMillisecond() const noexcept
測定された時間をミリ秒で取得
Definition mgl_chrono_elapsed_timer.h:33
uint64_t TickTime
Tickタイムを表す型
Definition mgl_chrono_defs.h:78
MGL 日付と時間