Use removeTimeout() when the timeout is no longer needed.
Example:
addTimeout(1.0, () {
writeln("One second passed!");
});void addTimeout(double seconds, TimeoutCallback callback)Adds a one-shot timeout callback.
The callback will be invoked once after the specified delay. Use repeatTimeout() inside the callback to create a repeating timer.
seconds | Delay in seconds before callback is invoked |
callback | Function to call |
Use removeTimeout() when the timeout is no longer needed.
Example:
addTimeout(1.0, () {
writeln("One second passed!");
});