diff --git a/src/TestSessionEnvironment.php b/src/TestSessionEnvironment.php index 89443dc..f6fcb09 100644 --- a/src/TestSessionEnvironment.php +++ b/src/TestSessionEnvironment.php @@ -573,11 +573,11 @@ class TestSessionEnvironment */ public function waitForPendingRequests($await = 700, $timeout = 10000) { - $timeout = TestSessionState::microtime() + $timeout; + $timeout = TestSessionState::millitime() + $timeout; $interval = max(300, $await); do { - $now = TestSessionState::microtime(); + $now = TestSessionState::millitime(); if ($timeout < $now) { return false; diff --git a/src/TestSessionState.php b/src/TestSessionState.php index 1afd494..7cc3835 100644 --- a/src/TestSessionState.php +++ b/src/TestSessionState.php @@ -53,7 +53,7 @@ class TestSessionState extends DataObject $update = SQLUpdate::create(sprintf('"%s"', $schema->tableName(self::class))) ->addWhere(['ID' => 1]) ->assignSQL('"PendingRequests"', '"PendingRequests" - 1') - ->assign('"LastResponseTimestamp"', self::microtime()); + ->assign('"LastResponseTimestamp"', self::millitime()); $update->execute(); } @@ -63,7 +63,7 @@ class TestSessionState extends DataObject * * @return float milliseconds since 1970 */ - public static function microtime() + public static function millitime() { return round(microtime(true) * 1000); }