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
//
......@@ -43,7 +43,7 @@ void SleepInSeconds(double s)
#include "Gmsh.h"
#include <windows.h>
long GetTimeInSeconds()
double GetTimeInSeconds()
{
FILETIME 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
#
......@@ -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
// $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
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment