Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
timer.hh
Go to the documentation of this file.
1#ifndef __TIMER_HH
2#define __TIMER_HH
3
4#include <sys/time.h>
5
6/**
7 * \author cpellegrino
8 */
9
10class Timer : public timeval
11{
12 public:
13
14 // Copy constructor
15 Timer(const Timer& t)
16 {
17 set(t);
18 }
19
20 Timer(long int seconds, long int useconds)
21 {
22 set(seconds, useconds);
23 }
24
25 // Default constructor
27 {}
28
29 // Expiration Check
30 bool hasExpired() const;
31
32 bool hasExpiredWrt(Timer const& t) const;
33
34 void set(long int seconds, long int useconds);
35
36 void set(const Timer& t)
37 {
38 tv_sec = t.tv_sec;
39 tv_usec = t.tv_usec;
40 }
41};
42
43#endif
Definition timer.hh:11
Timer(const Timer &t)
Definition timer.hh:15
Timer()
Definition timer.hh:26
bool hasExpiredWrt(Timer const &t) const
Definition timer.cc:7
void set(long int seconds, long int useconds)
Definition timer.cc:27
Timer(long int seconds, long int useconds)
Definition timer.hh:20
bool hasExpired() const
Definition timer.cc:21
void set(const Timer &t)
Definition timer.hh:36