Skip to content

Commit

Permalink
Merge pull request #76 from zhangchn/patch-2
Browse files Browse the repository at this point in the history
Fix wrong time unit in Service->delay()
  • Loading branch information
andot authored Mar 22, 2018
2 parents b6d266e + be30164 commit 2797fdc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Hprose/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,9 @@ protected function doFunctionList() {
$stream->close();
return $data;
}
protected function delay($interval, $data) {
$seconds = floor($interval);
$nanoseconds = ($interval - $seconds) * 1000000000;
protected function delay($milliseconds, $data) {
$seconds = floor($milliseconds / 1000);
$nanoseconds = ($milliseconds % 1000) * 1000000;
time_nanosleep($seconds, $nanoseconds);
return Future\value($data);
}
Expand Down

0 comments on commit 2797fdc

Please sign in to comment.