in reply to Re: Run code every 6seconde
in thread Run code every 6seconde

If it takes 3 seconds for FONCTION1() to run, and 4 seconds for FONCTION2(), your script waits 5 seconds for the next run. An alternative way would be:
my $next = time; while (1) { $next = time if $next < time; $next += 6; FONCTION1; FONCTION2; sleep $next - time; }
This still has all the caveats of using sleep (may sleep longer, may be terminated by a signal, may actually sleep for a second if the argument is 0), but it won't miss its "slot" if a run of FONCTION1(); FONCTION2() takes more than 6 seconds.