Skip to content

Instantly share code, notes, and snippets.

@gnrfan
Created March 27, 2014 00:33
Show Gist options
  • Save gnrfan/9797188 to your computer and use it in GitHub Desktop.
Save gnrfan/9797188 to your computer and use it in GitHub Desktop.
A script that takes the number of seconds it must wait to render a simple text message. Useful for testing web server timeout configurations.
<?php
$seconds = 60 * 2; // nginx default is 60 seconds
set_time_limit (60*60*24); // PHP keeps waiting for a whole day!
if (array_key_exists('s', $_REQUEST)) {
$seconds = intval($_REQUEST['s']);
}
sleep($seconds);
header("Content-Type: text/plain");
echo "This page took $seconds second(s) to print this message!\n";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment