Merge pull request #4342 from gudnimg/optimsation_timer_class
optimisation: Timer constructor can be `constexpr`
This commit is contained in:
commit
f5d48cd029
|
|
@ -6,17 +6,6 @@
|
|||
#include "Timer.h"
|
||||
#include "system_timer.h"
|
||||
|
||||
/**
|
||||
* @brief construct Timer
|
||||
*
|
||||
* It is guaranteed, that construction is equivalent with zeroing all members.
|
||||
* This property can be exploited in menu_data.
|
||||
*/
|
||||
template<typename T>
|
||||
Timer<T>::Timer() : m_isRunning(false), m_started()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Start timer
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -17,7 +17,10 @@ template <class T>
|
|||
class Timer
|
||||
{
|
||||
public:
|
||||
Timer();
|
||||
inline constexpr Timer()
|
||||
: m_isRunning(false)
|
||||
, m_started(0) {};
|
||||
|
||||
void start();
|
||||
void stop(){m_isRunning = false;}
|
||||
bool running()const {return m_isRunning;}
|
||||
|
|
|
|||
Loading…
Reference in New Issue