Timer(3pm) | User Contributed Perl Documentation | Timer(3pm) |
Coro::Timer - timers and timeouts, independent of any event loop
# This package is mostly obsoleted by Coro::AnyEvent. use Coro::Timer qw(timeout); # nothing exported by default
This package has been mostly obsoleted by Coro::AnyEvent, the only really useful function left in here is "timeout".
This is used by Coro itself to implement the "timed_down", "timed_wait" etc. primitives. It is used like this:
sub timed_wait { my $timeout = Coro::Timer::timeout 60; while (condition false) { Coro::schedule; # wait until woken up or timeout return 0 if $timeout; # timed out } return 1; # condition satisfied }
Marc A. Lehmann <schmorp@schmorp.de> http://software.schmorp.de/pkg/Coro.html
2022-10-20 | perl v5.36.0 |