time.c 399 B

1234567891011121314151617181920212223242526272829303132333435
  1. #include <sys/time.h>
  2. #include <time.h>
  3. #include "mpiP.h"
  4. double MPI_Wtime(void);
  5. double FC_FUNC( mpi_wtime, MPI_WTIME )(void)
  6. {
  7. return(MPI_Wtime());
  8. }
  9. double MPI_Wtime(void)
  10. {
  11. struct timeval tv;
  12. if (gettimeofday(&tv,0))
  13. {
  14. fprintf(stderr,"MPI_Wtime: error calling gettimeofday()\n");
  15. abort();
  16. }
  17. return((double)(tv.tv_sec) + (double)(tv.tv_usec)/1e6) ;
  18. }