aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Timer.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/Timer.cc b/src/Timer.cc
index 79b0939..2c981d3 100644
--- a/src/Timer.cc
+++ b/src/Timer.cc
@@ -19,16 +19,17 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22#include "Timer.hh"
23
22//use GNU extensions 24//use GNU extensions
23#ifndef _GNU_SOURCE 25#ifndef _GNU_SOURCE
24#define _GNU_SOURCE 26#define _GNU_SOURCE
25#endif // _GNU_SOURCE 27#endif // _GNU_SOURCE
26 28
27#ifdef HAVE_CONFIG_H 29#ifdef HAVE_CONFIG_H
28#include "../config.h" 30#include "../config.h"
29#endif // HAVE_CONFIG_H 31#endif // HAVE_CONFIG_H
30 32
31#include "Timer.hh"
32#include <sys/types.h> 33#include <sys/types.h>
33#include <unistd.h> 34#include <unistd.h>
34#include <cassert> 35#include <cassert>
@@ -43,7 +44,7 @@ m_once(false) {
43} 44}
44 45
45 46
46BTimer::~BTimer(void) { 47BTimer::~BTimer() {
47 if (isTiming()) stop(); 48 if (isTiming()) stop();
48} 49}
49 50
@@ -62,7 +63,7 @@ void BTimer::setTimeout(timeval t) {
62} 63}
63 64
64 65
65void BTimer::start(void) { 66void BTimer::start() {
66 gettimeofday(&m_start, 0); 67 gettimeofday(&m_start, 0);
67 68
68 if (! m_timing) { 69 if (! m_timing) {
@@ -72,13 +73,13 @@ void BTimer::start(void) {
72} 73}
73 74
74 75
75void BTimer::stop(void) { 76void BTimer::stop() {
76 m_timing = false; 77 m_timing = false;
77 removeTimer(this); //remove us from the list 78 removeTimer(this); //remove us from the list
78} 79}
79 80
80 81
81void BTimer::fireTimeout(void) { 82void BTimer::fireTimeout() {
82 if (m_handler) m_handler->timeout(); 83 if (m_handler) m_handler->timeout();
83} 84}
84 85