Actual source code: PetscGetTime.c

  1: /*$Id: PetscGetTime.c,v 1.17 2001/03/23 23:25:45 balay Exp $*/

 3:  #include petsc.h

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

 14:   for (i=0; i<2; i++) {
 15:     PetscGetTime(&x);
 16:     PetscGetTime(&y);
 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);

 27:     fprintf(stdout,"%-15s : %e secn","PetscGetTime",(y-x)/10.0);
 28:   }

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