We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 76ae124 commit 9c00119Copy full SHA for 9c00119
tests/PHPCurlClass/server.php
@@ -274,17 +274,19 @@
274
$server->serve($unsafe_file_path);
275
exit;
276
} elseif ($test === 'timeout') {
277
+ // Use --no-buffer to view loading indicator (e.g.
278
+ // curl --header "X-DEBUG-TEST: timeout" --include --no-buffer 127.0.0.1:8000/?seconds=3).
279
header('Content-Type: application/json');
- $unsafe_seconds = $_GET['seconds'];
- $start = time();
280
+ $unsafe_seconds = (int)$_GET['seconds'];
281
+ $start = microtime(true);
282
echo '{' . "\n";
283
echo ' "loading": "';
284
while (true) {
285
echo '.';
286
ob_flush();
287
flush();
288
sleep(1);
- $elapsed = time() - $start;
289
+ $elapsed = microtime(true) - $start;
290
if ($elapsed >= $unsafe_seconds) {
291
break;
292
}
0 commit comments