Jet  v1.3.3
timer.h
Go to the documentation of this file.
1 // Copyright (c) 2018 Doyub Kim
2 //
3 // I am making my contributions/submissions to this project solely in my
4 // personal capacity and am not conveying any rights to any intellectual
5 // property of any third parties.
6 
7 #ifndef INCLUDE_JET_TIMER_H_
8 #define INCLUDE_JET_TIMER_H_
9 
10 #include <chrono>
11 
12 namespace jet {
13 
15 class Timer {
16  public:
18  Timer();
19 
21  double durationInSeconds() const;
22 
24  void reset();
25 
26  private:
27  std::chrono::steady_clock _clock;
28  std::chrono::steady_clock::time_point _startingPoint;
29 };
30 
31 } // namespace jet
32 
33 #endif // INCLUDE_JET_TIMER_H_
jet::Timer
Simple timer class.
Definition: timer.h:15
jet
Definition: advection_solver2.h:18
jet::Timer::Timer
Timer()
Constructs the timer and start ticking.
jet::Timer::durationInSeconds
double durationInSeconds() const
Returns the time duration since the creation or reset in seconds.
jet::Timer::reset
void reset()
Resets the timer.