#!/usr/bin/perl use Event; sub whatever{ #here I do my staff waiting for messages through the spread toolkit #Here I could check what time is if N time has passed i could do anything, but i have no way to check it if not any event has hapenned. } #here I launch it on event Event->io(fd => $spread->fd, cb => \&put_output); Event::loop();