Skip to content
Snippets Groups Projects
Commit 0d8285da authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

*** empty log message ***

parent 5e8b536b
No related branches found
No related tags found
No related merge requests found
// $Id: Timer.cpp,v 1.19 2006-02-25 07:02:20 geuzaine Exp $ // $Id: Timer.cpp,v 1.20 2006-02-25 07:07:29 geuzaine Exp $
// //
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
// //
...@@ -43,7 +43,7 @@ void SleepInSeconds(double s) ...@@ -43,7 +43,7 @@ void SleepInSeconds(double s)
#include "Gmsh.h" #include "Gmsh.h"
#include <windows.h> #include <windows.h>
long GetTimeInSeconds() double GetTimeInSeconds()
{ {
FILETIME ft; FILETIME ft;
GetSystemTimeAsFileTime(&ft); GetSystemTimeAsFileTime(&ft);
......
# $Id: Makefile,v 1.25 2006-01-28 18:44:19 geuzaine Exp $ # $Id: Makefile,v 1.26 2006-02-25 07:05:37 geuzaine Exp $
# #
# Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle # Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
# #
...@@ -54,4 +54,4 @@ depend: ...@@ -54,4 +54,4 @@ depend:
ParUtil.o: ParUtil.cpp ../Common/Gmsh.h ../Common/Message.h \ ParUtil.o: ParUtil.cpp ../Common/Gmsh.h ../Common/Message.h \
../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \ ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
ParUtil.h ../Common/Timer.h ParUtil.h
// $Id: ParUtil.cpp,v 1.14 2006-01-06 00:34:27 geuzaine Exp $ // $Id: ParUtil.cpp,v 1.15 2006-02-25 07:05:37 geuzaine Exp $
// //
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
// //
...@@ -20,13 +20,11 @@ ...@@ -20,13 +20,11 @@
// Please report all bugs and problems to <gmsh@geuz.org>. // Please report all bugs and problems to <gmsh@geuz.org>.
#include "Gmsh.h" #include "Gmsh.h"
#include "Timer.h"
#include "ParUtil.h" #include "ParUtil.h"
#if defined(HAVE_PARALLEL) #if defined(HAVE_PARALLEL)
#include "mpi.h" #include "mpi.h"
#elif !defined(WIN32) || defined(__CYGWIN__)
# include <time.h> // FIXME: for sgi and maybe others
# include <sys/time.h>
#endif #endif
ParUtil *ParUtil::Instance() ParUtil *ParUtil::Instance()
...@@ -68,20 +66,8 @@ double ParUtil::wTime() const ...@@ -68,20 +66,8 @@ double ParUtil::wTime() const
{ {
#ifdef HAVE_PARALLEL #ifdef HAVE_PARALLEL
return MPI_Wtime(); return MPI_Wtime();
#elif !defined(WIN32) || defined(__CYGWIN__)
struct timeval tp;
struct timezone tzp;
double timeval;
gettimeofday(&tp, &tzp);
timeval = (double)tp.tv_sec;
timeval = timeval + (double)((double).000001 * (double)tp.tv_usec);
return (timeval);
#else #else
Msg(GERROR, "wTime not implemented on Windows without Cygwin"); return GetTimeInSeconds();
return 1.;
#endif #endif
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment