Return the remaining time of any timers, or nextTimeout if none active. The idiom is to pass it -1, and it returns it if no timers running. This was meant for the single-thread version of the State Machines and is not currently used.
| 94 | // The idiom is to pass it -1, and it returns it if no timers running. |
| 95 | // This was meant for the single-thread version of the State Machines and is not currently used. |
| 96 | int L3TimerList::remainingTime() { |
| 97 | int nextTimeout = -1; |
| 98 | for (L3TimerId tid = (L3TimerId)0; tid < cNumTimers; tid = (L3TimerId)(tid + 1)) { |
| 99 | if (mtlTimers[tid].tIsActive()) { |
| 100 | int remaining = mtlTimers[tid].tRemaining(); |
| 101 | if (nextTimeout == -1) { |
| 102 | nextTimeout = remaining; |
| 103 | } else { |
| 104 | nextTimeout = min(nextTimeout,remaining); |
| 105 | } |
| 106 | } |
| 107 | } |
| 108 | return nextTimeout; |
| 109 | } |
| 110 | }; |
no test coverage detected