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