[haXe] Feature: timers in neko
Michael Pliskin
pl at tepkom.ru
Fri Nov 3 19:23:06 CET 2006
Hello Nicolas,
NC> You can sleep using neko.Sys.sleep(seconds).
NC> This is a bit different from a timer which is an event.
Ok, that's pretty enough for my needs... BTW timer in neko could be
implemented like
function setTimeout(action, timeout) {
neko.Thread.create(function (t) {
neko.Sys.sleep(t); action();
}, timeout);
}
with the only problem that action() would have to invoke the code in
another thread... not sure if it is safe.
--
Best regards,
Michael mailto:pl at tepkom.ru
More information about the Haxe
mailing list