Actual source code: MPI_Wtime.c
1: /*$Id: MPI_Wtime.c,v 1.18 2001/08/29 20:59:42 balay Exp $*/
3: #include petsc.h
5: int main(int argc,char **argv)
6: {
7: double x,y;
8: int ierr;
9:
10: PetscInitialize(&argc,&argv,0,0);
11: /* To take care of paging effects */
12: y = MPI_Wtime();
14: x = MPI_Wtime();
15: y = MPI_Wtime();
16: y = MPI_Wtime();
17: y = MPI_Wtime();
18: y = MPI_Wtime();
19: y = MPI_Wtime();
20: y = MPI_Wtime();
21: y = MPI_Wtime();
22: y = MPI_Wtime();
23: y = MPI_Wtime();
24: y = MPI_Wtime();
26: fprintf(stdout,"%-15s : %e secn","MPI_Wtime",(y-x)/10.0);
27: y = MPI_Wtick();
28: fprintf(stdout,"%-15s : %e secn","MPI_Wtick",y);
30: x = MPI_Wtime();
31: PetscSleep(10);
32: y = MPI_Wtime();
33: fprintf(stdout,"%-15s : %e sec - Slept for 10 sec n","MPI_Wtime",(y-x));
35: PetscFinalize();
36: return(0);
37: }