reapply changes to the timer class that got lost somehow
This commit is contained in:
@ -64,7 +64,10 @@ class Timer : protected Pointers {
|
||||
void init_timeout();
|
||||
|
||||
// trigger enforced timeout
|
||||
void force_timeout();
|
||||
void force_timeout() { _timeout = 0.0; }
|
||||
|
||||
// restore original timeout setting after enforce timeout
|
||||
void reset_timeout() { _timeout = _s_timeout; }
|
||||
|
||||
// get remaining time in seconds. 0.0 if inactive, negative if expired
|
||||
double get_timeout_remain();
|
||||
@ -75,7 +78,7 @@ class Timer : protected Pointers {
|
||||
// check for timeout. inline wrapper around internal
|
||||
// function to reduce overhead in case there is no check.
|
||||
bool check_timeout(int step) {
|
||||
_laststep = step;
|
||||
if (_timeout == 0.0) return true;
|
||||
if (_nextcheck != step) return false;
|
||||
else return _check_timeout();
|
||||
}
|
||||
@ -91,9 +94,9 @@ class Timer : protected Pointers {
|
||||
int _level; // level of detail: off=0,loop=1,normal=2,full=3
|
||||
int _sync; // if nonzero, synchronize tasks before setting the timer
|
||||
int _timeout; // max allowed wall time in seconds. infinity if negative
|
||||
int _s_timeout; // copy of timeout for restoring after a forced timeout
|
||||
int _checkfreq; // frequency of timeout checking
|
||||
int _nextcheck; // loop number of next timeout check
|
||||
int _laststep; // loop number of last iteration
|
||||
|
||||
// update one specific timer array
|
||||
void _stamp(enum ttype);
|
||||
|
||||
Reference in New Issue
Block a user