Skip to content

Commit

Permalink
Ensure intervals passed nto uv_timer_start are integers and rounded…
Browse files Browse the repository at this point in the history
… off upwards as suggested by @clue at reactphp#112 (comment)
  • Loading branch information
WyriHaximus committed Dec 10, 2018
1 parent ad0d2f7 commit e9881a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ExtUvLoop.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function addTimer($interval, $callback)
$this->timerEvents->attach($timer, $event);
\uv_timer_start(
$event,
(int)($interval * 1000),
(int)ceil($interval * 1000),
0,
$callback
);
Expand All @@ -131,8 +131,8 @@ public function addPeriodicTimer($interval, $callback)
$this->timerEvents->attach($timer, $event);
\uv_timer_start(
$event,
$interval * 1000,
$interval * 1000,
(int)ceil($interval * 1000),
(int)ceil($interval * 1000),
$callback
);

Expand Down

0 comments on commit e9881a4

Please sign in to comment.