Fix issues with stop watch on windows.

This commit is contained in:
Pavel Krajcevski 2012-11-07 15:21:02 -05:00
parent e3757fde74
commit 9360e80a56

View file

@ -19,12 +19,14 @@
#include "TexCompTypes.h" #include "TexCompTypes.h"
#include <cassert> #include <cassert>
#include <Windows.h>
class StopWatchImpl { class StopWatchImpl {
public:
uint64 frequency; uint64 frequency;
uint64 start; uint64 start;
uint64 stop; uint64 stop;
uintptr affinityMask; uintptr_t affinityMask;
StopWatchImpl() : StopWatchImpl() :
start(0), stop(0), affinityMask(0) start(0), stop(0), affinityMask(0)
@ -108,7 +110,7 @@ double StopWatch::TimeInSeconds() const
{ {
// Return the elapsed time in seconds. // Return the elapsed time in seconds.
assert((impl->stop - impl->start) > 0); assert((impl->stop - impl->start) > 0);
return double(impl->stop - impl->start) / double(frequency); return double(impl->stop - impl->start) / double(impl->frequency);
} }
// Get the elapsed time in milliseconds. // Get the elapsed time in milliseconds.
@ -116,7 +118,7 @@ double StopWatch::TimeInMilliseconds() const
{ {
// Return the elapsed time in milliseconds. // Return the elapsed time in milliseconds.
assert((impl->stop - impl->start) > 0); assert((impl->stop - impl->start) > 0);
return double(impl->stop - impl->start) / double(frequency) * 1000.0; return double(impl->stop - impl->start) / double(impl->frequency) * 1000.0;
} }
// Get the elapsed time in microseconds. // Get the elapsed time in microseconds.