sub vicous { #.... for (0..int(rand(1000))) { sleep(int(rand(10)));# this takes at most 10s }; #... }