xref: /petsc/src/benchmarks/PetscTime.c (revision 3a40ed3dce77c081171d005ae1a6ff4bb9d13b6f)
1 #ifdef PETSC_RCS_HEADER
2 static char vcid[] = "$Id: PetscTime.c,v 1.9 1997/07/09 21:01:29 balay Exp bsmith $";
3 #endif
4 
5 #include "petsc.h"
6 #include "pinclude/ptime.h"
7 
8 int main( int argc, char **argv)
9 {
10   PLogDouble x, y;
11   int        i;
12 
13   PetscInitialize(&argc, &argv,0,0);
14   /* To take care of paging effects */
15   PetscTime(y);
16 
17   for ( i=0; i<2; i++ ) {
18     PetscTime(x);
19     PetscTime(y);
20     PetscTime(y);
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 
30     fprintf(stderr,"%-15s : %e sec\n","PetscTime",(y-x)/10.0);
31   }
32   PetscTime(x);
33   PetscSleep(10);
34   PetscTime(y);
35   fprintf(stderr,"%-15s : %e sec - Slept for 10 sec \n","PetscTime",(y-x));
36 
37   PetscFinalize();
38   PetscFunctionReturn(0);
39 }
40