source: CPL/oasis3-mct/branches/OASIS3-MCT_2.0_branch/lib/mct/mpi-serial/time.c @ 4775

Last change on this file since 4775 was 4775, checked in by aclsce, 4 years ago
  • Imported oasis3-mct from Cerfacs svn server (not suppotred anymore).

The version has been extracted from https://oasis3mct.cerfacs.fr/svn/branches/OASIS3-MCT_2.0_branch/oasis3-mct@1818

File size: 399 bytes
Line 
1
2#include <sys/time.h>
3#include <time.h>
4
5
6#include "mpiP.h"
7
8
9double MPI_Wtime(void);
10
11
12
13double FC_FUNC( mpi_wtime, MPI_WTIME )(void)
14{
15  return(MPI_Wtime());
16}
17
18
19
20double MPI_Wtime(void)
21{
22  struct timeval tv;
23
24  if (gettimeofday(&tv,0))
25    {
26      fprintf(stderr,"MPI_Wtime: error calling gettimeofday()\n");
27      abort();
28    }
29
30
31  return((double)(tv.tv_sec) + (double)(tv.tv_usec)/1e6) ;
32}
33
34
35
Note: See TracBrowser for help on using the repository browser.