| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TimerForSequencer.h
Go to the documentation of this file.
1 // $Id: TimerForSequencer.h,v 1.5 2004/11/25 13:26:26 mato Exp $
2 #ifndef TIMERFORSEQUENCER_H
3
4 #include "GaudiKernel/MsgStream.h"
5 #include "GaudiKernel/Timing.h"
6
14 class TimerForSequencer
15 {
16
17 public:
18
20 TimerForSequencer( const std::string& name,
21 const unsigned int size,
22 const double factor )
23 : m_name ( name ),
24 m_size ( size ),
25 m_factor ( factor ),
26 m_startClock ( 0LL ),
27 m_startCpu ( 0LL ),
28 m_num ( 0LL ),
29 m_lastTime ( 0. ),
30 m_lastCpu ( 0. ),
31 m_min ( 0. ),
32 m_max ( 0. ),
33 m_sum ( 0. ),
34 m_sumCpu ( 0. )
35 { }
36
37 ~TimerForSequencer() {}
38
40 inline void start ()
41 {
42 m_startClock = System::currentTime( System::microSec );
43 m_startCpu = System::cpuTime ( System::microSec );
44 }
45
49 double stop();
50
52 inline const std::string& name() const { return m_name; }
53
55 inline double lastTime() const { return m_lastTime; }
56
58 inline double lastCpu() const { return m_lastCpu; }
59
61 inline double elapsedTotal() const { return m_sum; }
62
64 inline double cpuTotal() const { return m_sumCpu; }
65
67 inline double count() const { return (double)m_num; }
68
70 MsgStream & fillStream(MsgStream & s) const;
71
73 static std::string header( std::string::size_type size );
74
75 private:
76
77 std::string m_name;
78 unsigned int m_size;
79 double m_factor;
80 long long m_startClock;
81 long long m_startCpu;
82
83 long long m_num;
84 double m_lastTime;
85 double m_lastCpu;
86 double m_min;
87 double m_max;
88 double m_sum;
89 double m_sumCpu;
90 };
91
92 inline MsgStream& operator<<(MsgStream& ms, const TimerForSequencer& count)
93 {
94 return count.fillStream( ms );
95 }
96
97 #endif // TIMERFORSEQUENCER_H