From 0d8285da5f27e339b46f91fd594da9245de9e70d Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sat, 25 Feb 2006 07:07:29 +0000 Subject: [PATCH] *** empty log message *** --- Common/Timer.cpp | 4 ++-- Parallel/Makefile | 4 ++-- Parallel/ParUtil.cpp | 22 ++++------------------ 3 files changed, 8 insertions(+), 22 deletions(-) diff --git a/Common/Timer.cpp b/Common/Timer.cpp index 24b4a9c81b..e50932522c 100644 --- a/Common/Timer.cpp +++ b/Common/Timer.cpp @@ -1,4 +1,4 @@ -// $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 // @@ -43,7 +43,7 @@ void SleepInSeconds(double s) #include "Gmsh.h" #include <windows.h> -long GetTimeInSeconds() +double GetTimeInSeconds() { FILETIME ft; GetSystemTimeAsFileTime(&ft); diff --git a/Parallel/Makefile b/Parallel/Makefile index 095eeea3e5..140ddaa80b 100644 --- a/Parallel/Makefile +++ b/Parallel/Makefile @@ -1,4 +1,4 @@ -# $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 # @@ -54,4 +54,4 @@ depend: ParUtil.o: ParUtil.cpp ../Common/Gmsh.h ../Common/Message.h \ ../DataStr/Malloc.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 diff --git a/Parallel/ParUtil.cpp b/Parallel/ParUtil.cpp index 91e7ee884c..4dcbce90bd 100644 --- a/Parallel/ParUtil.cpp +++ b/Parallel/ParUtil.cpp @@ -1,4 +1,4 @@ -// $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 // @@ -20,13 +20,11 @@ // Please report all bugs and problems to <gmsh@geuz.org>. #include "Gmsh.h" +#include "Timer.h" #include "ParUtil.h" #if defined(HAVE_PARALLEL) -# include "mpi.h" -#elif !defined(WIN32) || defined(__CYGWIN__) -# include <time.h> // FIXME: for sgi and maybe others -# include <sys/time.h> +#include "mpi.h" #endif ParUtil *ParUtil::Instance() @@ -68,20 +66,8 @@ double ParUtil::wTime() const { #ifdef HAVE_PARALLEL 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 - Msg(GERROR, "wTime not implemented on Windows without Cygwin"); - return 1.; + return GetTimeInSeconds(); #endif } -- GitLab