- time: documentation ( source)
- set_time_limit: documentation ( source)
- register_shutdown_function: documentation ( source)
- sleep: documentation ( source)
- printf: documentation ( source)
<?php
$start = time();
register_shutdown_function(function() use ($start){
printf("running for about %s seconds", time()-$start);
sleep(2);
printf("this will trigger the timeout again");
});
set_time_limit(1);
sleep(2);
echo "this will trigger the timeout";