mirror of
https://github.com/love2d/love.git
synced 2026-08-21 13:09:56 +02:00
Fixed getMicroTime (for real this time)
This commit is contained in:
@@ -102,15 +102,15 @@ namespace sdl
|
|||||||
float Timer::getMicroTime() const
|
float Timer::getMicroTime() const
|
||||||
{
|
{
|
||||||
#ifdef LOVE_WINDOWS
|
#ifdef LOVE_WINDOWS
|
||||||
/*
|
__int64 ticks, freq;
|
||||||
long ticks, freq;
|
LARGE_INTEGER temp;
|
||||||
QueryPeformanceCounter(&ticks);
|
QueryPerformanceCounter(&temp);
|
||||||
QueryPeformanceFrequency(&freq);
|
ticks = temp.QuadPart;
|
||||||
long secs = ticks/freq;
|
QueryPerformanceFrequency(&temp);
|
||||||
long usecs = (ticks%freq)/(freq/1000000.0f);
|
freq = temp.QuadPart;
|
||||||
|
__int64 secs = ticks/freq;
|
||||||
|
__int64 usecs = (ticks%freq)/(freq/1000000.0f);
|
||||||
return secs%86400 + usecs/1000000.0f;
|
return secs%86400 + usecs/1000000.0f;
|
||||||
*/
|
|
||||||
return 0;
|
|
||||||
#else
|
#else
|
||||||
timeval t;
|
timeval t;
|
||||||
gettimeofday(&t, NULL);
|
gettimeofday(&t, NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user