summaryrefslogtreecommitdiff
path: root/CIAO/DAnCE/TM_Daemon/utils/Timer.h
blob: aae06bf2085e852bf8337900b1cf25e3390b05ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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