Actual source code: rs6000_time.c
1: #define PETSC_DLL
3: #include "petscsys.h"
4: #include <sys/time.h>
5: #include <sys/systemcfg.h>
9: PetscLogDouble rs6000_time(void)
10: {
11: timebasestruct_t t;
12: PetscLogDouble time;
16: /* read in the register values */
17: read_real_time(&t,TIMEBASE_SZ);
18:
19: /*
20: * Call the conversion routines unconditionally, to ensure
21: * that both values are in seconds and nanoseconds regardless
22: * of the hardware platform.
23: */
24: time_base_to_time(&t,TIMEBASE_SZ);
25:
26: time = t.tb_high + t.tb_low*1.0e-9;
27: PetscFunctionReturn(time);
28: }