X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=include%2Ftimer.h;h=f1a063e610b7a38de28ab5982f887c11011670f2;hp=d0b5d7f508466219ea690dd618d90e8f9a409440;hb=36b1cf96dd076a5ff15ae4e037d2f3499d13f380;hpb=484b9ac2ebf8f88dbe36bdc1d3a9c1b6a2b242eb diff --git a/include/timer.h b/include/timer.h index d0b5d7f..f1a063e 100644 --- a/include/timer.h +++ b/include/timer.h @@ -1,3 +1,38 @@ +/***************************************************************************** +** FILE IDENTIFICATION +** +** Name: timer.h +** Purpose: Header file for Timer class +** Author: Kevin Rosenberg +** Date Started: Sep 2000 +** +** This is part of the CTSim program +** Copyright (c) 1983-2001 Kevin Rosenberg +** +** $Id$ +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License (version 2) as +** published by the Free Software Foundation. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +******************************************************************************/ + +#ifndef _TIMER_H +#define _TIMER_H + +// pragma line required for Fedora 4 and wxWin 2.4.2 +#if defined(__GNUG__) && !defined(__APPLE__) + #pragma implementation "timer.h" +#endif + #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -6,6 +41,10 @@ #include #endif +#ifdef MSVC +#include +#endif + class Timer { public: @@ -51,6 +90,10 @@ class Timer return 0; return (now.tv_sec + static_cast(now.tv_usec) / 1000000.); +#elif defined(MSVC) + struct _timeb now; + _ftime (&now); + return (now.time + static_cast(now.millitm) / 1000.); #else return 0; #endif @@ -152,5 +195,6 @@ class TimerCollectiveMPI : public TimerMPI #endif +#endif // _TIMER_H