forked from lijiext/lammps
provide alternative to gettimeofday() for MSVC compilation
This commit is contained in:
parent
a48f1cbf00
commit
8dcd6fc48c
|
@ -148,12 +148,20 @@ int MPI_Finalize()
|
|||
|
||||
double MPI_Wtime()
|
||||
{
|
||||
#if defined(_MSC_VER)
|
||||
double t;
|
||||
|
||||
t = GetTickCount();
|
||||
t /= 1000.0;
|
||||
return t;
|
||||
#else
|
||||
double time;
|
||||
struct timeval tv;
|
||||
|
||||
gettimeofday(&tv,NULL);
|
||||
time = 1.0 * tv.tv_sec + 1.0e-6 * tv.tv_usec;
|
||||
return time;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
|
|
@ -34,8 +34,16 @@ double t_end;
|
|||
|
||||
double Get_Time( )
|
||||
{
|
||||
#if defined(_MSC_VER)
|
||||
double t;
|
||||
|
||||
t = GetTickCount();
|
||||
t /= 1000.0;
|
||||
return t;
|
||||
#else
|
||||
gettimeofday(&tim, NULL );
|
||||
return( tim.tv_sec + (tim.tv_usec / 1000000.0) );
|
||||
#endif
|
||||
}
|
||||
|
||||
int Tokenize( char* s, char*** tok )
|
||||
|
|
Loading…
Reference in New Issue