Actual source code: PetscTime.c

     2:  #include petsc.h
      3: #include "petscfix.h"
     4:  #include src/sys/src/plog/ptime.h

      8: int main(int argc,char **argv)
      9: {
     10:   PetscLogDouble x,y;
     11:   int            i,ierr;

     13:   PetscInitialize(&argc,&argv,0,0);
     14:   /* To take care of paging effects */
     15:   PetscTime(y);

     17:   for (i=0; i<2; i++) {
     18:     PetscTime(x);
     19:     PetscTime(y);
     20:     PetscTime(y);
     21:     PetscTime(y);
     22:     PetscTime(y);
     23:     PetscTime(y);
     24:     PetscTime(y);
     25:     PetscTime(y);
     26:     PetscTime(y);
     27:     PetscTime(y);
     28:     PetscTime(y);

     30:     fprintf(stdout,"%-15s : %e sec\n","PetscTime",(y-x)/10.0);
     31:   }
     32:   PetscTime(x);
     33:   PetscSleep(10);
     34:   PetscTime(y);
     35:   fprintf(stdout,"%-15s : %e sec - Slept for 10 sec \n","PetscTime",(y-x));

     37:   PetscFinalize();
     38:   return(0);
     39: }