r460: no message
[ctsim.git] / include / timer.h
index d0b5d7f508466219ea690dd618d90e8f9a409440..e938ae91936411919f34ce030a9b47c93bec1577 100644 (file)
@@ -1,3 +1,30 @@
+/*****************************************************************************
+** 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.6 2001/01/28 19:10:18 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
+******************************************************************************/
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -6,6 +33,10 @@
 #include <sys/time.h>
 #endif
 
+#ifdef MSVC
+#include <sys/timeb.h>
+#endif
+
 class Timer
 {
  public:
@@ -51,6 +82,10 @@ class Timer
                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