summaryrefslogtreecommitdiff
path: root/gi/clda/src/timer.h
diff options
context:
space:
mode:
Diffstat (limited to 'gi/clda/src/timer.h')
-rw-r--r--gi/clda/src/timer.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/gi/clda/src/timer.h b/gi/clda/src/timer.h
new file mode 100644
index 00000000..ca26b304
--- /dev/null
+++ b/gi/clda/src/timer.h
@@ -0,0 +1,18 @@
+#ifndef _TIMER_STATS_H_
+#define _TIMER_STATS_H_
+
+struct Timer {
+ Timer() { Reset(); }
+ void Reset() {
+ start_t = clock();
+ }
+ double Elapsed() const {
+ const clock_t end_t = clock();
+ const double elapsed = (end_t - start_t) / 1000000.0;
+ return elapsed;
+ }
+ private:
+ clock_t start_t;
+};
+
+#endif