From fcd49d500e2f07b084597cd72c53568ac46ef854 Mon Sep 17 00:00:00 2001 From: redpony Date: Tue, 22 Jun 2010 22:31:28 +0000 Subject: chris's crappy lda git-svn-id: https://ws10smt.googlecode.com/svn/trunk@6 ec762483-ff6d-05da-a07a-a48fb63a330f --- gi/clda/src/timer.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 gi/clda/src/timer.h (limited to 'gi/clda/src/timer.h') 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 -- cgit v1.2.3