1 #ifndef OPENANN_UTIL_STOPWATCH_H_
2 #define OPENANN_UTIL_STOPWATCH_H_
8 unsigned long begin, duration;
11 inline unsigned long getSystime()
15 return (
unsigned long) t.tv_sec * 1000000L + (
unsigned long) t.tv_usec;
34 inline unsigned long stop()
36 duration = getSystime() - begin;
47 unsigned long duration =
stop();
51 return duration / 1000000L;
53 return duration / 100000L;
55 return duration / 10000L;
57 return duration / 1000L;
74 #endif // OPENANN_UTIL_STOPWATCH_H_