ShishGL  1.0
A simple modular cross-platform graphics library
Time.hpp
Go to the documentation of this file.
1 /*============================================================================*/
2 #ifndef SHISHGL_TIMER_HPP
3 #define SHISHGL_TIMER_HPP
4 /*============================================================================*/
5 #include <chrono>
6 /*============================================================================*/
7 namespace Sh {
8 
9  using Clock = std::chrono::system_clock;
10  using TimePoint = Clock::time_point;
11  using TimeDelta = Clock::duration;
12 
13  /*------------------------------------------------------------------------*/
14 
15  class Timer {
16  public:
17 
18  Timer();
19 
20  virtual ~Timer() = default;
21 
22  void reset();
23 
24  [[nodiscard]]
25  TimeDelta elapsed() const;
26 
27  protected:
28 
30 
31  };
32 
33 }
34 /*============================================================================*/
35 #endif //SHISHGL_TIMER_HPP
36 /*============================================================================*/
Sh::Clock
std::chrono::system_clock Clock
Definition: Time.hpp:9
Sh::Timer::reset
void reset()
Definition: Time.cpp:11
Sh::Timer::~Timer
virtual ~Timer()=default
Sh::Timer::start_time
TimePoint start_time
Definition: Time.hpp:29
Sh::Timer::elapsed
TimeDelta elapsed() const
Definition: Time.cpp:17
Sh
Definition: CoreApplication.hpp:10
Sh::TimePoint
Clock::time_point TimePoint
Definition: Time.hpp:10
Sh::Timer::Timer
Timer()
Definition: Time.cpp:7
Sh::TimeDelta
Clock::duration TimeDelta
Definition: Time.hpp:11
Sh::Timer
Definition: Time.hpp:15