Thread watchdog bei einer while-Schleife
(20 answers)
Opened by perlensammler22 at 2015-09-22 07:29
Ich finde das schlüssiger:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 #!/usr/bin/perl use warnings; use strict; my $tstart = time(); my $t; print "Please wait (five seconds).\n"; while(1) { $t = time() - $tstart; if ($t >= 5) { print "Five seconds reached.\n"; last; } } View full thread watchdog bei einer while-Schleife |