linux build fix, sorry
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4919 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
b88a70aa50
commit
8f4149b370
|
@ -30,17 +30,17 @@
|
||||||
namespace Common
|
namespace Common
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef _WIN32
|
||||||
|
u32 Timer::GetTimeMs() {
|
||||||
|
return timeGetTime();
|
||||||
|
}
|
||||||
|
#else
|
||||||
u32 Timer::GetTimeMs()
|
u32 Timer::GetTimeMs()
|
||||||
{
|
{
|
||||||
struct timeb t;
|
struct timeb t;
|
||||||
ftime(&t);
|
ftime(&t);
|
||||||
return ((u32)(t.time * 1000 + t.millitm));
|
return ((u32)(t.time * 1000 + t.millitm));
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
u32 Timer::GetTimeMs() {
|
|
||||||
return timeGetTime();
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ Timer::Timer()
|
||||||
// Write the starting time
|
// Write the starting time
|
||||||
void Timer::Start()
|
void Timer::Start()
|
||||||
{
|
{
|
||||||
m_StartTime = timeGetTime();
|
m_StartTime = GetTimeMs();
|
||||||
m_Running = true;
|
m_Running = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,14 +70,14 @@ void Timer::Start()
|
||||||
void Timer::Stop()
|
void Timer::Stop()
|
||||||
{
|
{
|
||||||
// Write the final time
|
// Write the final time
|
||||||
m_LastTime = timeGetTime();
|
m_LastTime = GetTimeMs();
|
||||||
m_Running = false;
|
m_Running = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the last time variable
|
// Update the last time variable
|
||||||
void Timer::Update()
|
void Timer::Update()
|
||||||
{
|
{
|
||||||
m_LastTime = timeGetTime();
|
m_LastTime = GetTimeMs();
|
||||||
//TODO(ector) - QPF
|
//TODO(ector) - QPF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ void Timer::Update()
|
||||||
// Get the number of milliseconds since the last Update()
|
// Get the number of milliseconds since the last Update()
|
||||||
u64 Timer::GetTimeDifference()
|
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
|
/* 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
|
// Rrturn the final timer time if the timer is stopped
|
||||||
if (!m_Running) return (m_LastTime - m_StartTime);
|
if (!m_Running) return (m_LastTime - m_StartTime);
|
||||||
|
|
||||||
return (timeGetTime() - m_StartTime);
|
return (GetTimeMs() - m_StartTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the formattet time elapsed since the Start()
|
// Get the formattet time elapsed since the Start()
|
||||||
|
|
Loading…
Reference in New Issue