X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=common-src%2Fclock.h;h=0a6617043f8cf108d7fb44c8d1b77ea0b8605c8c;hb=HEAD;hp=391b3835a4494e2e7276bd948fd408df3878cfe7;hpb=12179dea039515c06168c0037d048566a3f623de;p=debian%2Famanda diff --git a/common-src/clock.h b/common-src/clock.h index 391b383..0a66170 100644 --- a/common-src/clock.h +++ b/common-src/clock.h @@ -1,6 +1,7 @@ /* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park + * Copyright (c) 2007-2012 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its @@ -34,31 +35,25 @@ #include "amanda.h" -typedef struct times_s { - struct timeval r; - -#ifdef INSTRUMENTATION - struct timeval u,s; -#endif -} 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 +typedef GTimeVal times_t; +/* NOT THREAD SAFE */ void startclock(void); times_t stopclock(void); times_t curclock(void); -times_t timesadd(times_t a, times_t b); -times_t timessub(times_t a, times_t b); -char * times_str(times_t t); 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); + + #endif /* CLOCK_H */