Assuming that FONCTION1 and FONCTION2 will reliably execute in less than 6 seconds, and that exact timing is not critical:
my $did_this_time = 0; while (1) { my $now = time; if ( $now != $did_this_time && $now % 6 == 0 ) { $did_this_time = $now; FONCTION1(); FONCTION2(); } }
update: forgot to mention that this will keep the CPU rather busy... Adding a sleep 1; to the loop will help with that.
In reply to Re: Run code every 6seconde
by keszler
in thread Run code every 6seconde
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |