-
Notifications
You must be signed in to change notification settings - Fork 78
/
jiffieclock.hh
43 lines (34 loc) · 954 Bytes
/
jiffieclock.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef CLICK_JiffieClock_HH
#define CLICK_JiffieClock_HH
#include <click/element.hh>
#include <click/timer.hh>
#include <click/task.hh>
#include <click/sync.hh>
CLICK_DECLS
/* =c
* JiffieClock()
* =s
* Aggregate jiffies at CLICK_HZ frequency instead of relying on TSC.
*
*/
class JiffieClock : public Element { public:
JiffieClock() CLICK_COLD;
const char *class_name() const override { return "JiffieClock"; }
const char *port_count() const override { return PORTS_0_0; }
int configure(Vector<String> &, ErrorHandler *) CLICK_COLD;
int initialize(ErrorHandler *) CLICK_COLD;
void run_timer(Timer*);
bool run_task(Task*);
static String read_param(Element *e, void *thunk);
void add_handlers();
static click_jiffies_t read_jiffies(void* user);
private:
Task _task;
Timer _timer;
Timestamp last_jiffies_update;
click_jiffies_t jiffies;
bool _verbose;
int _minprecision;
};
CLICK_ENDDECLS
#endif