File: vclock.c

package info (click to toggle)
moon-buggy 1%3A1.0.51-15
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,316 kB
  • sloc: ansic: 3,824; sh: 3,567; makefile: 162
file content (34 lines) | stat: -rw-r--r-- 629 bytes parent folder | download | duplicates (3)
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);
}