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
|
/* vclock.c - high-precision wall clock time
*
* Copyright 1998 Jochen Voss. */
static const char rcsid[] = "$Id: vclock.c 5726 2004-06-01 21:22:28Z voss $";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef _XOPEN_SOURCE
#define _XOPEN_SOURCE_EXTENDED 1
#endif
#include <sys/time.h>
#if defined(__hp9000s800)
#include <stdarg.h>
#endif
#include "moon-buggy.h"
double
vclock (void)
/* Return the elapsed (wall clock) time (measured in seconds) since
* some base time with greater precision than `time()' does. */
{
struct timeval x;
gettimeofday (&x, NULL);
return (x.tv_sec + x.tv_usec*1.0e-6);
}
|