MythTV  master
mythtimer.h
Go to the documentation of this file.
1 #ifndef MYTHTIMER_H_
2 #define MYTHTIMER_H_
3 
4 #include <cinttypes>
5 #include <QElapsedTimer>
6 #include "mythbaseexp.h"
7 
14 {
15  public:
16  typedef enum {
19  } StartState;
20 
21  explicit MythTimer(StartState state = kStartInactive);
22 
23  void start(void);
24  int restart(void);
25  void stop(void);
26 
27  void addMSecs(int ms);
28 
29  int elapsed(void) const;
30  int64_t nsecsElapsed(void) const;
31  bool isRunning(void) const;
32 
33  private:
34  QElapsedTimer m_timer;
35  int m_offset {0};
36 };
37 
38 #endif
A QElapsedTimer based timer to replace use of QTime as a timer.
Definition: mythtimer.h:13
QElapsedTimer m_timer
Definition: mythtimer.h:34
#define MBASE_PUBLIC
Definition: mythbaseexp.h:15
static bool isRunning(const char *program)
Returns true if a program containing the specified string is running on this machine.