chiark / gitweb /
wip make it compile; add warnings to Makefile
[inn-innduct.git] / include / inn / timer.h
1 /*  $Id: timer.h 6129 2003-01-19 00:39:49Z rra $
2 **
3 **  Timer library interface.
4 **
5 **  An interface to a simple profiling library.  An application can declare
6 **  its intent to use n timers by calling TMRinit(n), and then start and
7 **  stop numbered timers with TMRstart and TMRstop.  TMRsummary logs the
8 **  results to syslog given labels for each numbered timer.
9 */
10
11 #ifndef INN_TIMER_H
12 #define INN_TIMER_H
13
14 #include <inn/defines.h>
15
16 BEGIN_DECLS
17
18 enum {
19     TMR_HISHAVE,                /* Looking up ID in history (yes/no). */
20     TMR_HISGREP,                /* Looking up ID in history (data). */
21     TMR_HISWRITE,               /* Writing to history. */
22     TMR_HISSYNC,                /* Syncing history to disk. */
23     TMR_APPLICATION             /* Application numbering starts here. */
24 };
25
26 void            TMRinit(unsigned int);
27 void            TMRstart(unsigned int);
28 void            TMRstop(unsigned int);
29 void            TMRsummary(const char *prefix, const char *const *labels);
30 unsigned long   TMRnow(void);
31 void            TMRfree(void);
32
33 /* Return the current time as a double of seconds and fractional sections. */
34 double TMRnow_double(void);
35
36 END_DECLS
37
38 #endif /* INN_TIMER_H */