Unverified Commit 8dcd6fc4 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

provide alternative to gettimeofday() for MSVC compilation

parent a48f1cbf
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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
}

/* ---------------------------------------------------------------------- */
+8 −0
Original line number Diff line number Diff line
@@ -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 )