aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Timer.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/Timer.hh')
-rw-r--r--src/FbTk/Timer.hh8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/FbTk/Timer.hh b/src/FbTk/Timer.hh
index 61bb11b..773d5b8 100644
--- a/src/FbTk/Timer.hh
+++ b/src/FbTk/Timer.hh
@@ -64,8 +64,9 @@ public:
64 /// set timeout 64 /// set timeout
65 void setTimeout(time_t val); 65 void setTimeout(time_t val);
66 /// set timeout 66 /// set timeout
67 void setTimeout(timeval val); 67 void setTimeout(const timeval &val);
68 void setCommand(RefCount<Command> &cmd); 68 void setCommand(RefCount<Command> &cmd);
69 void setInterval(int val) { m_interval = val; }
69 /// start timing 70 /// start timing
70 void start(); 71 void start();
71 /// stop timing 72 /// stop timing
@@ -73,7 +74,8 @@ public:
73 /// update all timers 74 /// update all timers
74 static void updateTimers(int file_descriptor); 75 static void updateTimers(int file_descriptor);
75 76
76 inline int isTiming() const { return m_timing; } 77 inline int isTiming() const { return m_timing; }
78 inline int getInterval() const { return m_interval; }
77 inline int doOnce() const { return m_once; } 79 inline int doOnce() const { return m_once; }
78 80
79 inline const timeval &getTimeout() const { return m_timeout; } 81 inline const timeval &getTimeout() const { return m_timeout; }
@@ -96,6 +98,8 @@ private:
96 98
97 bool m_timing; ///< clock running? 99 bool m_timing; ///< clock running?
98 bool m_once; ///< do timeout only once? 100 bool m_once; ///< do timeout only once?
101 int m_interval; ///< Is an interval-only timer (e.g. clock)
102 // note that intervals only take note of the seconds, not microseconds
99 103
100 timeval m_start; ///< start time 104 timeval m_start; ///< start time
101 timeval m_timeout; ///< time length 105 timeval m_timeout; ///< time length