-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimer.h
More file actions
33 lines (25 loc) · 687 Bytes
/
timer.h
File metadata and controls
33 lines (25 loc) · 687 Bytes
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
/*
* timer.h
*
* Created on: Mar 25, 2009
* Author: pushkar
*/
#ifndef TIMER_H_
#define TIMER_H_
#include <stdio.h>
#include <signal.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
using namespace std;
namespace Timer {
/// Get Current Time
double getCurrentTime();
/// Subscribe func to the process Timer. func is called when last_time misses to update itself after an interval interval
void subscribeToTimer(void (*func)(void), double interval, double* last_time);
/// Timer signal Handler
void iHandler(int sig);
/// Start timer here. Only one instance of this timer can be created for every process
int startTimer();
}
#endif /* TIMER_H_ */