mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 18:59:33 +00:00
bug in timer calculation
git-svn-id: https://svn.fhem.de/fhem/trunk@2271 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c61e85da4e
commit
6bcfbab454
@ -1921,6 +1921,7 @@ HandleTimeout()
|
||||
my $now = gettimeofday();
|
||||
return ($nextat-$now) if($now < $nextat);
|
||||
|
||||
$now += 0.01;# need to cover min delay at least
|
||||
$nextat = 0;
|
||||
#############
|
||||
# Check the internal list.
|
||||
@ -1936,13 +1937,15 @@ HandleTimeout()
|
||||
&{$fn}($intAt{$i}{ARG});
|
||||
use strict "refs";
|
||||
delete($intAt{$i});
|
||||
}
|
||||
} else {
|
||||
$nextat = $tim if(!$nextat || $nextat > $tim);
|
||||
}
|
||||
}
|
||||
|
||||
return undef if(!$nextat);
|
||||
$now = gettimeofday();
|
||||
return ($now < $nextat) ? ($nextat-$now) : 0;
|
||||
$now = gettimeofday(); # possibly some tasks did timeout in the meantime
|
||||
# we will cover them
|
||||
return ($now+ 0.01 < $nextat) ? ($nextat-$now) : 0.01;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user