Actual source code: rs6000_time.c
1: /*$Id: rs6000_time.c,v 1.11 2001/04/10 19:34:38 bsmith Exp $*/
3: #include petsc.h
4: #if defined (PETSC_USE_READ_REAL_TIME)
5: #include <sys/time.h>
6: #include <sys/systemcfg.h>
8: PetscLogDouble rs6000_time(void)
9: {
10: timebasestruct_t t;
11: PetscLogDouble time;
15: /* read in the register values */
16: read_real_time(&t,TIMEBASE_SZ);
17:
18: /*
19: * Call the conversion routines unconditionally, to ensure
20: * that both values are in seconds and nanoseconds regardless
21: * of the hardware platform.
22: */
23: time_base_to_time(&t,TIMEBASE_SZ);
24:
25: time = t.tb_high + t.tb_low*1.0e-9;
26: PetscFunctionReturn(time);
27: }
28: #endif