Actual source code: rs6000_time.c

      1: #define PETSC_DLL

     3:  #include petsc.h
      4: #if defined (PETSC_USE_READ_REAL_TIME)
      5: #include <sys/time.h>
      6: #include <sys/systemcfg.h>

     10: PetscLogDouble PETSC_DLLEXPORT rs6000_time(void)
     11: {
     12:    timebasestruct_t t;
     13:    PetscLogDouble   time;

     17:    /* read in the register values */
     18:    read_real_time(&t,TIMEBASE_SZ);
     19:
     20:    /*
     21:     * Call the conversion routines unconditionally, to ensure
     22:     * that both values are in seconds and nanoseconds regardless
     23:     * of the hardware platform.
     24:     */
     25:    time_base_to_time(&t,TIMEBASE_SZ);
     26:
     27:    time = t.tb_high + t.tb_low*1.0e-9;
     28:    PetscFunctionReturn(time);
     29: }
     30: #endif