Class Watchdog
A deadman timer that expires unless fed often enough.
public sealed class Watchdog : IDisposable
- Inheritance
-
Watchdog
- Implements
- Inherited Members
Constructors
Watchdog(float)
Creates a watchdog that expires after a silence of timeout.
public Watchdog(float timeout)
Parameters
timeoutfloatThe allowed silence; its magnitude is used, and one that is not a number is taken as 0.
Properties
IsExpired
Gets whether the watchdog has expired.
public bool IsExpired { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Feed()
Feeds the watchdog, restarting its silence timer.
public void Feed()
Update(float)
Advances the timer and reports whether it has expired.
public bool Update(float dt)
Parameters
dtfloatThe time since the last update; one that is not a finite number expires the watchdog until it is fed.
Returns
- bool
Whether the watchdog has expired.