diff --git a/CHANGELOG b/CHANGELOG index 2d02e3d..93b5f57 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ # dev -- n/a +- Repeat watchers in LibeventReactor internally were handled in + microsecond intervals instead of milliseconds. ### 1.0.3 diff --git a/lib/LibeventReactor.php b/lib/LibeventReactor.php index 72f146c..c7f0045 100644 --- a/lib/LibeventReactor.php +++ b/lib/LibeventReactor.php @@ -298,10 +298,11 @@ class LibeventReactor implements Reactor { */ public function repeat(callable $callback, $msInterval, array $options = []) { assert(($msInterval >= 0), "\$msInterval at Argument 2 expects integer >= 0"); + $msInterval *= 1000; if (isset($options["ms_delay"])) { $msDelay = (int) $options["ms_delay"]; assert(($msDelay >= 0), "ms_delay option expects integer >= 0"); - $msDelay = ($msDelay * 1000); + $msDelay *= 1000; } else { $msDelay = $msInterval; }