aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Timer.hh
diff options
context:
space:
mode:
authorsimonb <simonb>2006-04-18 15:17:11 (GMT)
committersimonb <simonb>2006-04-18 15:17:11 (GMT)
commit4c011a0a12a06ae87e9bdd296ce503131a292d27 (patch)
treefdcdc41e1e3de9bc952b6cdf0b9c5fc21da137fd /src/FbTk/Timer.hh
parent939ffc7ef1ba358e4f7bf874fe24a0418d40eb41 (diff)
downloadfluxbox-4c011a0a12a06ae87e9bdd296ce503131a292d27.zip
fluxbox-4c011a0a12a06ae87e9bdd296ce503131a292d27.tar.bz2
don't check the clock so often...
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