2019-03-25 00:42:15 +00:00
|
|
|
#pragma once
|
|
|
|
|
2019-05-28 11:48:06 +00:00
|
|
|
#include <sys/time.h>
|
2019-03-25 00:42:15 +00:00
|
|
|
|
2019-04-10 14:14:44 +00:00
|
|
|
class CElapsedTimer {
|
2019-03-25 00:42:15 +00:00
|
|
|
public:
|
2019-05-28 09:53:16 +00:00
|
|
|
CElapsedTimer() {}
|
2019-03-25 00:42:15 +00:00
|
|
|
|
2019-04-01 20:03:32 +00:00
|
|
|
bool is_valid() const { return m_valid; }
|
2019-03-25 00:42:15 +00:00
|
|
|
void start();
|
|
|
|
int elapsed() const;
|
|
|
|
|
|
|
|
private:
|
2019-04-01 20:03:32 +00:00
|
|
|
bool m_valid { false };
|
2019-05-28 09:53:16 +00:00
|
|
|
struct timeval m_start_time {
|
|
|
|
0, 0
|
|
|
|
};
|
2019-03-25 00:42:15 +00:00
|
|
|
};
|