MarlinUtil  1.12.1
SimpleTimer.h
1 #ifndef SIMPLETIMER_H
2 #define SIMPLETIMER_H 1
3 
4 #include "marlin/Processor.h"
5 #include "lcio.h"
6 
7 #include <UTIL/LCTime.h>
8 
9 #include <iostream>
10 
11 #include <unistd.h>
12 
13 
14 using namespace lcio ;
15 using namespace marlin ;
16 
17 
18 
19 
20 
38 class SimpleTimer : public Processor {
39 
40  public:
41 
42  virtual Processor* newProcessor() { return new SimpleTimer ; }
43 
44  SimpleTimer() ;
45 
46  virtual void init() ;
47  virtual void processRunHeader( LCRunHeader* run ) ;
48  virtual void processEvent( LCEvent* evt ) ;
49  virtual void check( LCEvent* evt ) ;
50  virtual void end() ;
51 
52 
53  protected:
54 
55  int _nRun;
56  int _nEvt;
57 
58  int _startTime;
59  int _time;
60  LCTime* _startTimer;
61  LCTime* _currentTimer;
62  int _mode;
63  int _secondsToWait;
64  int _secondsPerEvent;
65  int _secondsOfJob;
66  int _minutesOfJob;
67 
68  void wait(int sleepTime);
69 
70 };
71 
72 #endif
Simple timimg processor, which offers a delay after an event has been processed.
Definition: SimpleTimer.h:38