#ifndef __STATISTICS_H #define __STATISTICS_H #include "common.h" namespace GtpVisibilityPreprocessor { // -------------------------------------------------------------- // Statistics for search - base class // -------------------------------------------------------------- class StatisticsBase { public: // return time diff. in s static inline double TimeDiff(long time1, long time2) // in s { const double clk=1.0E-6; // ticks per second long t=time2-time1; return ((t<0)?-t:t)*clk; } public: long startTime; long stopTime; void Start() { startTime = GetTime(); } void Stop() { stopTime = GetTime(); } float Time() const { return (float)TimeDiff(startTime, stopTime); } }; } #endif