Some fixes to avoid virtual function calls in timer
This commit is contained in:
@@ -111,7 +111,9 @@ TimerImplWin32::TimerImplWin32(void)
|
||||
{
|
||||
if (QueryPerformanceFrequency(&freq_)==FALSE)
|
||||
throw std::runtime_error("Performance counter of of stock!");
|
||||
reset();
|
||||
|
||||
memset(&count_,0,sizeof(count_));
|
||||
memset(&start_,0,sizeof(count_));
|
||||
}
|
||||
|
||||
void TimerImplWin32::reset(void)
|
||||
@@ -231,7 +233,7 @@ static const unsigned long clockticks = CLOCKS_PER_SEC;
|
||||
class TimerImplStd : public TimerImpl
|
||||
{
|
||||
public:
|
||||
TimerImplStd() : freq_(clockticks),count_(0),start_(0) { reset(); }
|
||||
TimerImplStd() : freq_(clockticks),count_(0),start_(0) { }
|
||||
~TimerImplStd() { ; }
|
||||
|
||||
virtual void reset(void) override { count_ = 0; }
|
||||
|
||||
Reference in New Issue
Block a user