Thread id of the setInterval() timer to be cancelled
import nyinaa.timers: setInterval, stopInterval; import std.stdio : writeln; import std.datetime : msecs; import std.concurrency : Tid; import core.thread.osthread : Thread; void main() { Tid b = setInterval(1000.msecs, (){ writeln("Hello from spawned thread B"); }); // Let wait for 2 seconds Thread.sleep(2000.msecs); // cancel timer stopInterval(b); }
Cancels a setInterval() timer