Created
June 5, 2014 07:50
-
-
Save anonymous/bf3a3f276f060fe58942 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v5.10; | |
use Mojo::IOLoop; | |
say EV::now; | |
say localtime.': sleeping 5...'; | |
sleep(2); | |
Mojo::IOLoop->one_tick; # updates EV::now | |
say EV::now; | |
say localtime.': register 5 sec timeout...'; | |
Mojo::IOLoop->timer(2 => sub { say localtime.': timeout!'; shift->stop; }); | |
say localtime.': starting ioloop...'; | |
Mojo::IOLoop->start(); | |
say localtime.': done'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment