xref: /petsc/src/benchmarks/PetscGetTime.c (revision e1311b9049e89cb3452dcd306fde571f4b440ff2)
1 #ifdef PETSC_RCS_HEADER
2 static char vcid[] = "$Id: PetscGetTime.c,v 1.7 1997/10/19 03:30:47 bsmith Exp balay $";
3 #endif
4 
5 #include "petsc.h"
6 
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