X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=include%2Ftimer.h;h=226d258c85ca181fcaf1abe478be1efdb796de02;hb=e98a8a9d72a7b919debbbc9d1b0f237fe71c0fb3;hp=d0b5d7f508466219ea690dd618d90e8f9a409440;hpb=484b9ac2ebf8f88dbe36bdc1d3a9c1b6a2b242eb;p=ctsim.git diff --git a/include/timer.h b/include/timer.h index d0b5d7f..226d258 100644 --- a/include/timer.h +++ b/include/timer.h @@ -1,3 +1,34 @@ +/***************************************************************************** +** 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: timer.h,v 1.7 2001/02/22 11:05:38 kevin Exp $ +** +** 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 + + #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -6,6 +37,10 @@ #include #endif +#ifdef MSVC +#include +#endif + class Timer { public: @@ -51,6 +86,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 +191,6 @@ class TimerCollectiveMPI : public TimerMPI #endif +#endif // _TIMER_H