X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=common-src%2Fclock.h;h=0f7ce1eb1a7c43242edb9a43527d3ac994a1b9b5;hb=94a044f90357edefa6f4ae9f0b1d5885b0e34aee;hp=4da1cfca8757559e6f29bb2fbc65653b1e3cb89a;hpb=1194fb66aa28d9929c3f2bef3cc6c1c3f40a60a4;p=debian%2Famanda diff --git a/common-src/clock.h b/common-src/clock.h index 4da1cfc..0f7ce1e 100644 --- a/common-src/clock.h +++ b/common-src/clock.h @@ -25,7 +25,7 @@ * University of Maryland at College Park */ /* - * $Id: clock.h,v 1.5 2002/04/08 00:16:18 jrjackson Exp $ + * $Id: clock.h,v 1.6 2006/05/25 01:47:11 johnfranks Exp $ * * interface for timing functions */ @@ -34,31 +34,27 @@ #include "amanda.h" -typedef struct times_s { - struct timeval r; - -#ifdef INSTRUMENTATION - struct timeval u,s; -#endif -} times_t; +typedef GTimeVal times_t; extern times_t times_zero, start_time; -#ifdef HAVE_TWO_ARG_GETTIMEOFDAY -# define amanda_timezone struct timezone -# define amanda_gettimeofday(x, y) gettimeofday((x), (y)) -#else -# define amanda_timezone int -# define amanda_gettimeofday(x, y) gettimeofday((x)) -#endif +/* NOT THREAD SAFE */ +void startclock(void); +times_t stopclock(void); +times_t curclock(void); +char * walltime_str(times_t t); +int clock_is_running(void); + +/* Thread safe */ +times_t timeadd(times_t a, times_t b); +#define timesadd(x, y) timeadd(x, y) + +times_t timesub(times_t a, times_t b); +#define timessub(x, y) timesub(x, y) + +double g_timeval_to_double(GTimeVal v); + +void amanda_gettimeofday(struct timeval * timeval_time); -void startclock P((void)); -times_t stopclock P((void)); -times_t curclock P((void)); -times_t timesadd P((times_t a, times_t b)); -times_t timessub P((times_t a, times_t b)); -char * times_str P((times_t t)); -char * walltime_str P((times_t t)); -int clock_is_running P((void)); #endif /* CLOCK_H */