use Time::HiRes qw(time); $thu = "5.00"; $a="0"; $s=time; while ($a=="0"){ $t=time; $f=($t-$s); print "$f\n"; if ($f==$thu){$a="1";} }