+/*****************************************************************************
+** 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 interface "timer.h"
+#endif
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <sys/time.h>
#endif
+#ifdef MSVC
+#include <sys/timeb.h>
+#endif
+
class Timer
{
public:
return 0;
return (now.tv_sec + static_cast<double>(now.tv_usec) / 1000000.);
+#elif defined(MSVC)
+ struct _timeb now;
+ _ftime (&now);
+ return (now.time + static_cast<double>(now.millitm) / 1000.);
#else
return 0;
#endif
#endif
+#endif // _TIMER_H