summaryrefslogtreecommitdiff
path: root/Source/Core/Common
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2010-01-21 20:49:45 +0000
committerhrydgard <hrydgard@gmail.com>2010-01-21 20:49:45 +0000
commit8f4149b3703f4e59cab57638347dfe15bd571285 (patch)
tree8e12fea238962eeae47f74412566df23674fc12a /Source/Core/Common
parentb88a70aa507e5b5bb96c70d1046bb8c8d0a91052 (diff)
linux build fix, sorry
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4919 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common')
-rw-r--r--Source/Core/Common/Src/Timer.cpp20
1 files 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()