package bin; import kernel.Timer; import kernel.ps.ProcessHandle; import kernel.ps.Process; class HelloWorldService implements Process { private var timer:Timer; public function new() {} public function run(handle:ProcessHandle) { handle.write("Hello World! Started\n"); this.startTimer(handle); handle.addDeferFunc(()->{ timer.cancle(); }); } public function startTimer(handle: ProcessHandle) { this.timer = new Timer(5, function() { handle.write("Hello World!\n"); this.startTimer(handle); }); } }