From 8f4149b3703f4e59cab57638347dfe15bd571285 Mon Sep 17 00:00:00 2001 From: hrydgard Date: Thu, 21 Jan 2010 20:49:45 +0000 Subject: [PATCH] linux build fix, sorry git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4919 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/Timer.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Source/Core/Common/Src/Timer.cpp b/Source/Core/Common/Src/Timer.cpp index 4759729769..3fc1f79574 100644 --- a/Source/Core/Common/Src/Timer.cpp +++ b/Source/Core/Common/Src/Timer.cpp @@ -30,17 +30,17 @@ namespace Common { -#ifdef __GNUC__ +#ifdef _WIN32 +u32 Timer::GetTimeMs() { + return timeGetTime(); +} +#else u32 Timer::GetTimeMs() { struct timeb t; ftime(&t); return ((u32)(t.time * 1000 + t.millitm)); } -#else -u32 Timer::GetTimeMs() { - return timeGetTime(); -} #endif @@ -62,7 +62,7 @@ Timer::Timer() // Write the starting time void Timer::Start() { - m_StartTime = timeGetTime(); + m_StartTime = GetTimeMs(); m_Running = true; } @@ -70,14 +70,14 @@ void Timer::Start() void Timer::Stop() { // Write the final time - m_LastTime = timeGetTime(); + m_LastTime = GetTimeMs(); m_Running = false; } // Update the last time variable void Timer::Update() { - m_LastTime = timeGetTime(); + m_LastTime = GetTimeMs(); //TODO(ector) - QPF } @@ -90,7 +90,7 @@ void Timer::Update() // Get the number of milliseconds since the last Update() u64 Timer::GetTimeDifference() { - return(timeGetTime() - m_LastTime); + return GetTimeMs() - m_LastTime; } /* Add the time difference since the last Update() to the starting time. This is used to compensate @@ -115,7 +115,7 @@ u64 Timer::GetTimeElapsed() // Rrturn the final timer time if the timer is stopped if (!m_Running) return (m_LastTime - m_StartTime); - return (timeGetTime() - m_StartTime); + return (GetTimeMs() - m_StartTime); } // Get the formattet time elapsed since the Start()