MythTV
master
libs
libmythbase
mythtimer.h
Go to the documentation of this file.
1
#ifndef MYTHTIMER_H_
2
#define MYTHTIMER_H_
3
4
#include <QElapsedTimer>
5
#include "
mythbaseexp.h
"
6
#include "
mythchrono.h
"
7
13
class
MBASE_PUBLIC
MythTimer
14
{
15
public
:
16
enum
StartState
{
17
kStartRunning
,
18
kStartInactive
,
19
};
20
21
explicit
MythTimer
(StartState state = kStartInactive);
22
23
void
start(
void
);
24
std::chrono::milliseconds restart(
void
);
25
void
stop(
void
);
26
27
void
addMSecs(std::chrono::milliseconds ms);
28
29
std::chrono::milliseconds elapsed(
void
);
30
std::chrono::nanoseconds nsecsElapsed(
void
)
const
;
31
bool
isRunning
(
void
)
const
;
32
33
private
:
34
QElapsedTimer
m_timer
;
35
std::chrono::milliseconds m_offset {0ms};
36
};
37
38
#endif
MythTimer::m_timer
QElapsedTimer m_timer
Definition:
mythtimer.h:34
MythTimer::kStartInactive
@ kStartInactive
Definition:
mythtimer.h:18
MythTimer
A QElapsedTimer based timer to replace use of QTime as a timer.
Definition:
mythtimer.h:13
mythbaseexp.h
MythTimer::StartState
StartState
Definition:
mythtimer.h:16
MBASE_PUBLIC
#define MBASE_PUBLIC
Definition:
mythbaseexp.h:15
isRunning
static bool isRunning(const char *program)
Returns true if a program containing the specified string is running on this machine.
Definition:
mythtv/programs/mythshutdown/main.cpp:202
MythTimer::kStartRunning
@ kStartRunning
Definition:
mythtimer.h:17
mythchrono.h
Generated on Tue Apr 6 2021 03:17:52 for MythTV by
1.8.17