xref: /petsc/src/benchmarks/PetscTime.c (revision ac2a4f0d24b3b6a4ee93edbcad41f4bb9e923944)
1 /*$Id: PetscTime.c,v 1.12 1999/09/02 14:54:26 bsmith Exp bsmith $*/
2 
3 #include "petsc.h"
4 #include "pinclude/ptime.h"
5 
6 #undef __FUNC__
7 #define __FUNC__ "main"
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   ierr = PetscSleep(10);CHKERRA(ierr);
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