Merge pull request #5 from cjcliffe/master

Win32 timer class fix
This commit is contained in:
Charles J. Cliffe 2014-11-17 18:17:10 -05:00
commit 44542dd878
2 changed files with 5 additions and 4 deletions

View File

@ -23,7 +23,7 @@
#include "Timer.h" #include "Timer.h"
#ifdef _WIN32 #ifdef WIN32
#include <mmsystem.h> #include <mmsystem.h>
#endif #endif
@ -97,7 +97,7 @@ void Timer::update(void)
} }
else else
{ {
#ifdef _WIN32 #ifdef WIN32
system_milliseconds = timeGetTime (); system_milliseconds = timeGetTime ();
#else #else
gettimeofday(&time_val,&time_zone); gettimeofday(&time_val,&time_zone);

View File

@ -24,9 +24,10 @@
#ifndef TIMER_H #ifndef TIMER_H
#define TIMER_H #define TIMER_H
#ifndef _WIN32 #ifndef WIN32
#include <sys/time.h> #include <sys/time.h>
#endif #endif
#include <windows.h>
/// Timer Class, high resolution timer /// Timer Class, high resolution timer
/** /**
@ -46,7 +47,7 @@ private:
unsigned long paused_time; unsigned long paused_time;
unsigned long offset; unsigned long offset;
#ifndef _WIN32 #ifndef WIN32
struct timeval time_val; struct timeval time_val;
struct timezone time_zone; struct timezone time_zone;
#endif #endif