Created
March 27, 2014 00:33
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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