Actual source code: PetscGetTime.c

petsc-3.3-p7 2013-05-11
  2: #include <petscsys.h>

  6: int main(int argc,char **argv)
  7: {
  8:   PetscLogDouble x,y;
  9:   int        i,ierr;
 10: 
 11:   PetscInitialize(&argc,&argv,0,0);
 12:  /* To take care of paging effects */
 13:   PetscGetTime(&y);

 15:   for (i=0; i<2; i++) {
 16:     PetscGetTime(&x);
 17:     PetscGetTime(&y);
 18:     PetscGetTime(&y);
 19:     PetscGetTime(&y);
 20:     PetscGetTime(&y);
 21:     PetscGetTime(&y);
 22:     PetscGetTime(&y);
 23:     PetscGetTime(&y);
 24:     PetscGetTime(&y);
 25:     PetscGetTime(&y);
 26:     PetscGetTime(&y);

 28:     fprintf(stdout,"%-15s : %e sec\n","PetscGetTime",(y-x)/10.0);
 29:   }

 31:   PetscFinalize();
 32:   return(0);
 33: }