#ifndef _PERF_TIMER_H_
#define _PERF_TIMER_H_
#ifdef _WIN32
#include <windows.h>
#else
#include <sys/time.h>
#endif
class PerfTimer
{
public:
PerfTimer();
~PerfTimer();
void reset();
void start();
void stop();
const double duration()const;
const double duration_milli_seconds()const;
const double duration_micro_seconds()const;
private:
#ifdef _WIN32
__int64 m_start_time;
__int64 m_stop_time;
__int64 m_freq;
#else
struct timeval m_start_time;
struct timeval m_stop_time;
#endif
};
#endif
#define _PERF_TIMER_H_
#ifdef _WIN32
#include <windows.h>
#else
#include <sys/time.h>
#endif
class PerfTimer
{
public:
PerfTimer();
~PerfTimer();
void reset();
void start();
void stop();
const double duration()const;
const double duration_milli_seconds()const;
const double duration_micro_seconds()const;
private:
#ifdef _WIN32
__int64 m_start_time;
__int64 m_stop_time;
__int64 m_freq;
#else
struct timeval m_start_time;
struct timeval m_stop_time;
#endif
};
#endif