1 /*$Id: PetscGetTime.c,v 1.10 1999/05/04 20:38:02 balay Exp bsmith $*/ 2 3 #include "petsc.h" 4 5 #undef __FUNC__ 6 #define __FUNC__ "main" 7 int main( int argc, char **argv) 8 { 9 PLogDouble x, y; 10 int i,ierr; 11 12 PetscInitialize(&argc, &argv,0,0); 13 /* To take care of paging effects */ 14 ierr = PetscGetTime(&y);CHKERRA(ierr); 15 16 for ( i=0; i<2; i++ ) { 17 ierr = PetscGetTime(&x);CHKERRA(ierr); 18 ierr = PetscGetTime(&y);CHKERRA(ierr); 19 ierr = PetscGetTime(&y);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 29 fprintf(stderr,"%-15s : %e sec\n","PetscGetTime", (y-x)/10.0); 30 } 31 32 PetscFinalize(); 33 PetscFunctionReturn(0); 34 } 35