summaryrefslogtreecommitdiff
path: root/CIAO/DAnCE/TM_Daemon/utils/Timer.h
diff options
context:
space:
mode:
Diffstat (limited to 'CIAO/DAnCE/TM_Daemon/utils/Timer.h')
-rw-r--r--CIAO/DAnCE/TM_Daemon/utils/Timer.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/CIAO/DAnCE/TM_Daemon/utils/Timer.h b/CIAO/DAnCE/TM_Daemon/utils/Timer.h
new file mode 100644
index 00000000000..aae06bf2085
--- /dev/null
+++ b/CIAO/DAnCE/TM_Daemon/utils/Timer.h
@@ -0,0 +1,48 @@
+#ifndef TIMER_H
+#define TIMER_H
+#include "ace/High_Res_Timer.h"
+
+namespace CIAO
+{
+ namespace TM_Daemon
+ {
+ namespace utils
+ {
+
+ class Timer
+ {
+ public:
+ Timer (const char* file);
+
+ Timer (const Timer &timer);
+
+ Timer ();
+
+ virtual void operator = (const Timer &timer);
+
+ virtual ~Timer ();
+
+ virtual void start ();
+
+ virtual void stop ();
+
+ virtual void dump ();
+
+
+ private:
+ /// The high resolution timer.
+ ACE_High_Res_Timer timer_;
+
+ /// Elapsed time.
+ ACE_hrtime_t elapsed_time_;
+
+ /// output file.
+ FILE * file_;
+
+ /// state of the timer
+ bool running_;
+ };
+ }
+ }
+}
+#endif