PITimeMeasurer remove some API, add elapsedAndReset()
got rid off some warnings
This commit is contained in:
@@ -833,11 +833,11 @@ bool PIThread::waitForFinish(PISystemTime timeout) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
tmf_.reset();
|
||||
while (tmf_.elapsed() < timeout) {
|
||||
PITimeMeasurer tm;
|
||||
while (tm.elapsed() < timeout) {
|
||||
if (_waitForFinish(PISystemTime::fromMilliseconds(PIP_MIN_MSLEEP))) return true;
|
||||
}
|
||||
return tmf_.elapsed() < timeout;
|
||||
return tm.elapsed() < timeout;
|
||||
}
|
||||
|
||||
|
||||
@@ -848,10 +848,10 @@ bool PIThread::waitForStart(PISystemTime timeout) {
|
||||
piMinSleep();
|
||||
return true;
|
||||
}
|
||||
tms_.reset();
|
||||
while (!running_ && tms_.elapsed() < timeout)
|
||||
PITimeMeasurer tm;
|
||||
while (!running_ && tm.elapsed() < timeout)
|
||||
piMinSleep();
|
||||
return tms_.elapsed() < timeout;
|
||||
return tm.elapsed() < timeout;
|
||||
}
|
||||
|
||||
|
||||
@@ -950,10 +950,10 @@ void PIThread::__thread_func__() {
|
||||
// PICout(PICoutManipulators::DefaultControls) << "thread" << this << "wait" << "...";
|
||||
PIINTROSPECTION_THREAD_WAIT(this);
|
||||
if (delay_.isNotNull()) {
|
||||
tmr_.reset();
|
||||
PITimeMeasurer tm;
|
||||
double sl(0.);
|
||||
while (1) {
|
||||
sl = piMind(delay_.toMilliseconds() - tmr_.elapsed_m(), PIP_MIN_MSLEEP);
|
||||
sl = piMind(delay_.toMilliseconds() - tm.elapsed_m(), PIP_MIN_MSLEEP);
|
||||
if (terminating) break;
|
||||
if (sl <= 0.) break;
|
||||
piMSleep(sl);
|
||||
|
||||
Reference in New Issue
Block a user