* University of Maryland at College Park
*/
/*
- * $Id: clock.c,v 1.2.2.2 2002/03/31 21:01:33 jrjackson Exp $
+ * $Id: clock.c,v 1.5 2002/04/08 00:16:18 jrjackson Exp $
*
* timing functions
*/
times_t start_time;
static int clock_running = 0;
-#ifdef HAVE_TWO_ARG_GETTIMEOFDAY
-# define amanda_gettimeofday(x, y) gettimeofday((x), (y))
-#else
-# define amanda_gettimeofday(x, y) gettimeofday((x))
-#endif
-
int clock_is_running()
{
return clock_running;
void startclock()
{
-#ifdef HAVE_TWO_ARG_GETTIMEOFDAY
- struct timezone dontcare;
-#endif
+ amanda_timezone dontcare;
clock_running = 1;
amanda_gettimeofday(&start_time.r, &dontcare);
{
times_t diff;
struct timeval end_time;
-
-#ifdef HAVE_TWO_ARG_GETTIMEOFDAY
- struct timezone dontcare;
-#endif
+ amanda_timezone dontcare;
if(!clock_running) {
fprintf(stderr,"stopclock botch\n");
{
times_t diff;
struct timeval end_time;
-
-#ifdef HAVE_TWO_ARG_GETTIMEOFDAY
- struct timezone dontcare;
-#endif
+ amanda_timezone dontcare;
if(!clock_running) {
fprintf(stderr,"curclock botch\n");
char *s;
/* tv_sec/tv_usec are longs on some systems */
- ap_snprintf(str[n], sizeof(str[n]),
+ snprintf(str[n], sizeof(str[n]),
"rtime %d.%03d", (int)t.r.tv_sec, (int)t.r.tv_usec/1000);
s = str[n++];
n %= am_countof(str);
char *s;
/* tv_sec/tv_usec are longs on some systems */
- ap_snprintf(str[n], sizeof(str[n]),
+ snprintf(str[n], sizeof(str[n]),
"%d.%03d", (int)t.r.tv_sec, (int)t.r.tv_usec/1000);
s = str[n++];
n %= am_countof(str);