switch to git no-history version
This commit is contained in:
28
src/Core/Timer.h
Normal file
28
src/Core/Timer.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef TIMER_H
|
||||
#define TIMER_H
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Timer /////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class Timer
|
||||
{
|
||||
public:
|
||||
void Start() { gettimeofday(&m_start, NULL); }
|
||||
|
||||
double StopWatch() {
|
||||
gettimeofday(&m_end, NULL);
|
||||
double timeSec = m_end.tv_sec - m_start.tv_sec +
|
||||
(m_end.tv_usec - m_start.tv_usec)*1E-6;
|
||||
return timeSec;
|
||||
}
|
||||
|
||||
private:
|
||||
struct timeval m_start, m_end;
|
||||
};
|
||||
|
||||
|
||||
#endif // TIMER_H
|
||||
Reference in New Issue
Block a user