Fixed LLFastTimers et al.

No longer crash when std::vector moves in memory when it grows.
Fixed display of timer values (in ms).
This commit is contained in:
Aleric Inglewood
2012-02-04 18:28:24 +01:00
parent b755bcd495
commit 5a455eac91
5 changed files with 201 additions and 68 deletions

View File

@@ -198,7 +198,7 @@ U64 get_clock_count()
return clock_count.QuadPart - offset;
}
F64 calc_clock_frequency(U32 uiMeasureMSecs)
F64 calc_clock_frequency(void)
{
__int64 freq;
QueryPerformanceFrequency((LARGE_INTEGER *) &freq);
@@ -209,7 +209,7 @@ F64 calc_clock_frequency(U32 uiMeasureMSecs)
#if LL_LINUX || LL_DARWIN || LL_SOLARIS
// Both Linux and Mac use gettimeofday for accurate time
F64 calc_clock_frequency(unsigned int uiMeasureMSecs)
F64 calc_clock_frequency(void)
{
return 1000000.0; // microseconds, so 1 Mhz.
}
@@ -226,7 +226,7 @@ U64 get_clock_count()
void update_clock_frequencies()
{
gClockFrequency = calc_clock_frequency(50U);
gClockFrequency = calc_clock_frequency();
gClockFrequencyInv = 1.0/gClockFrequency;
gClocksToMicroseconds = gClockFrequencyInv * SEC_TO_MICROSEC;
}