Fork::setTimeout - Implementation of setTimeout() function in JavaScript
use Fork::setTimeout;
my $timer = setTimeout(sub { ... }, 10); clearTimeout($timer);
An emulation of setTimeout() funcion in JavaScript using fork(2).
my $timer = setTimeout(sub { ... }, 10);
Dispatches $code
after $msec
micro seconds.
You should store the return value, $timer
, in some lexical variable
to wait for child process to finish dispatching $code
.
clearTimeout($timer);
Kills the child process and clear $timer
out.
Kentaro Kuribayashi kentarok@gmail.com
Copyright (C) Kentaro Kuribayashi
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.