Skip to content

Commit

Permalink
fix timeout setter
Browse files Browse the repository at this point in the history
  • Loading branch information
nekufa committed Feb 2, 2022
1 parent 52473a3 commit 12aa90c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ public function setLogger(?LoggerInterface $logger): self

public function setTimeout(float $value): self
{
$this->connect();
$seconds = (int) floor($value);
$milliseconds = (int) (1000 * ($value - $seconds));

Expand Down
2 changes: 1 addition & 1 deletion tests/SubjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class SubjectTest extends Test
{
public function testPerformance()
{
$client = $this->createClient()->setDelay(0);
$client = $this->createClient()->setTimeout(0.1)->setDelay(0);
$client->setLogger(null);

$this->logger?->info('start performance test');
Expand Down

0 comments on commit 12aa90c

Please sign in to comment.