-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimer.h
More file actions
70 lines (53 loc) · 1.71 KB
/
timer.h
File metadata and controls
70 lines (53 loc) · 1.71 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
* University of Leipzig: timer.h, v0.1b 21.9.97 22:58
*
*
* Copyright 1997 by University of Leipzig
*
* Permission to use, copy, modify, and distribute this software for noncommercial
* use and without fee is hereby granted, provided that the above copyright notice
* appear in all copies and that both that copyright notice and this permission
* notice appear in supporting documentation, and that the name of the U.L. not be
* used in advertising or publicity pertaining to distribution of the software
* without specific, written prior permission. The U.L. makes no representations about
* the suitability of this software for any purpose. It is provided "as is"
* without expressed or implied warranty.
*
*
* pantec@aix520.informatik.uni-leipzig.de (Thomas Pantzer)
*
*/
#ifndef _TIMER_H
#define _TIMER_H
#include <time.h>
#include "tns_util/porting.h"
#include <signal.h>
TNS_UTIL_API_EXTERN long int GetTime(void);
TNS_UTIL_API_EXTERN void InitTimer(void);
TNS_UTIL_API_EXTERN void DoneTimer(void);
TNS_UTIL_API_EXTERN char *timepostfix(double milliseconds, char *buffer);
TNS_UTIL_API_EXTERN char *TimeString(time_t now, char *buffer);
#ifdef OLDSTYLE_TIMER
typedef void (*sighandler_t)(int);
extern void InitTimer(sighandler_t handler, long isec, long iusec);
extern int timer_resolution;
extern char timer_rolled;
#endif
#ifndef linux
#ifdef sun
/* problem was solved
// I can't find the header file for this, but it exists
extern "C" {
extern void usleep(unsigned int);
}
*/
#else
#ifdef hpux
extern void usleep(long int i);
#endif
#endif
#endif
//globale Variablen für den Timer
//extern struct itimerval SavedTimer;
#include "tns_util/copyright.h"
#endif