Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / lwp / test / testtime.c
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
4 *
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
8 */
9
10 #include <afsconfig.h>
11 #include <afs/param.h>
12
13
14 #include <sys/time.h>
15
16 main()
17 {
18 struct timeval blat[10], notmuch;
19 unsigned int approx[3];
20 int i;
21 approx[0] = FT_ApproxTime();
22 notmuch.tv_sec = 0;
23 notmuch.tv_usec = 300000;
24 for (i = 0; i < 5; i++) {
25 FT_GetTimeOfDay(&blat[i], 0);
26 select(0, 0, 0, 0, &notmuch);
27 }
28 sleep(5);
29 approx[1] = FT_ApproxTime();
30 for (i = 5; i < 10; i++)
31 FT_GetTimeOfDay(&blat[i], 0);
32 sleep(5);
33 approx[2] = FT_ApproxTime();
34 for (i = 0; i < 10; i++)
35 printf("%u.%u\n", blat[i].tv_sec, blat[i].tv_usec);
36 printf("\n%u %u %u\n", approx[0], approx[1], approx[2]);
37 }