PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
timer.h
1#pragma once
2
3#include "pixelbullet/time/duration.h"
4
5#include <chrono>
6
7namespace pixelbullet
8{
9class Timer
10{
11public:
12 Timer();
13
14 void reset();
15
16 [[nodiscard]] Duration elapsed() const;
17
18 [[nodiscard]] double elapsed_seconds() const;
19
20 [[nodiscard]] double elapsed_milliseconds() const;
21
22private:
23 std::chrono::steady_clock::time_point start_;
24};
25} // namespace pixelbullet
Definition duration.h:6