1 #ifdef PETSC_RCS_HEADER 2 static char vcid[] = "$Id: PetscGetTime.c,v 1.9 1999/03/19 21:24:35 bsmith Exp balay $"; 3 #endif 4 5 #include "petsc.h" 6 7 #undef __FUNC__ 8 #define __FUNC__ "main" 9 int main( int argc, char **argv) 10 { 11 PLogDouble x, y; 12 int i,ierr; 13 14 PetscInitialize(&argc, &argv,0,0); 15 /* To take care of paging effects */ 16 ierr = PetscGetTime(&y);CHKERRA(ierr); 17 18 for ( i=0; i<2; i++ ) { 19 ierr = PetscGetTime(&x);CHKERRA(ierr); 20 ierr = PetscGetTime(&y);CHKERRA(ierr); 21 ierr = PetscGetTime(&y);CHKERRA(ierr); 22 ierr = PetscGetTime(&y);CHKERRA(ierr); 23 ierr = PetscGetTime(&y);CHKERRA(ierr); 24 ierr = PetscGetTime(&y);CHKERRA(ierr); 25 ierr = PetscGetTime(&y);CHKERRA(ierr); 26 ierr = PetscGetTime(&y);CHKERRA(ierr); 27 ierr = PetscGetTime(&y);CHKERRA(ierr); 28 ierr = PetscGetTime(&y);CHKERRA(ierr); 29 ierr = PetscGetTime(&y);CHKERRA(ierr); 30 31 fprintf(stderr,"%-15s : %e sec\n","PetscGetTime", (y-x)/10.0); 32 } 33 34 PetscFinalize(); 35 PetscFunctionReturn(0); 36 } 37