or download this
my @increments = (undef, 30, 300, 30000);
my @times = map {($_, time + $increments[$_])} 1..3;
...
@times = sort { $a->[1] <=> $b[1] } (@times, [$this_phase, $increments
+[$this_phase]);
alarm($times[0][1]);
my_garbage_collect($this_phase);