5
/* $Header: /tmp/hpctools/ga/tcgmsg/ipcv5.0/mtime.c,v 1.5 2002-03-12 18:59:31 d3h325 Exp $ */
15
* return wall clock time in centiseconds
20
return (long) (TCGTIME_()*100.0);
23
#if defined(LAPI) && defined(AIX)
30
# include <sys/types.h>
33
# include <sys/time.h>
36
static unsigned firstsec=0; /* Reference for timer */
37
static unsigned firstusec=0; /* Reference for timer */
39
void MtimeReset() /* Sets timer reference */
44
(void) gettimeofday(&tp,&tzp);
47
firstusec = tp.tv_usec;
52
* Return wall clock time in seconds as accurately as possible
56
static int firstcall=1;
67
(void) gettimeofday(&tp,&tzp);
69
low = (double) (tp.tv_usec>>1) - (double) (firstusec>>1);
70
high = (double) (tp.tv_sec - firstsec);
72
return high + 1.0e-6*(low+low);
80
# include <sys/time.h>
82
#if HAVE_SYS_SYSTEMCFG_H
83
# include <sys/systemcfg.h>
86
static int firstsec=0; /* Reference for timer */
87
static int firstnsec=0;
89
void MtimeReset() /* Sets timer reference */
92
read_real_time(&t, TIMEBASE_SZ);
93
time_base_to_time(&t, TIMEBASE_SZ);
101
* Return wall clock time in seconds as accurately as possible
105
static int firstcall=1;
116
read_real_time(&t, TIMEBASE_SZ);
117
time_base_to_time(&t, TIMEBASE_SZ);
119
secs = t.tb_high - firstsec;
120
nsecs = t.tb_low - firstnsec;
122
/* If there was a carry from low-order to high-order during
123
the measurement, we have to undo it */
128
return (double)(secs + 1.0e-9*nsecs);
131
#endif /* LAPI_AIX */