Skip to content

kentaro/Fork-setTimeout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

Fork::setTimeout - Implementation of setTimeout() function in JavaScript

SYNOPSIS

use Fork::setTimeout;

my $timer = setTimeout(sub { ... }, 10); clearTimeout($timer);

DESCRIPTION

An emulation of setTimeout() funcion in JavaScript using fork(2).

METHODS

setTimeout( I<$code>, I<$msec> )

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( I<$timer> )

clearTimeout($timer);

Kills the child process and clear $timer out.

AUTHOR

Kentaro Kuribayashi kentarok@gmail.com

SEE ALSO

LICENSE

Copyright (C) Kentaro Kuribayashi

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

About

Implementation of setTimeout() function in JavaScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages