« Switching page orientation in OpenOffice.org | Home | A few gFTP user interface oddities »
Simple timer script for command-line PHP
By admin | November 12, 2008
Are you looking for a simple timer script written in command-line PHP? If so, here is one pre-written (released under the GPL v2 or later):
<?php define("endl","\n"); // Timer script if($argv[1] == "") { echo "Usage: ".$argv[0]." minutes".endl; die(); } $dtime = strtotime("+".$argv[1]." minute"); while(true) { echo "Enter to check time: "; $tt = fgets(STDIN); $i = date("i",$dtime-time()); $s = date("s",$dtime-time()); echo "$i minutes, $s seconds".endl; } ?>Usage: When launching use first parameter as number of minutes to count (0-59 min). Press enter to check the time.
If you found this script useful or helpful, please help Compdigitec by spreading the word. Don’t forget to subscribe to Compdigitec Labs for more interesting articles!
If you found this article helpful or interesting, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful and interesting articles!
Topics: PHP | 4 Comments »
4 Responses to “Simple timer script for command-line PHP”
Comments
July 11th, 2024 at 23:42
… [Trackback]
[…] There you will find 67691 more Info to that Topic: compdigitec.com/labs/2008/11/12/simple-timer-script-for-command-line-php/ […]
July 21st, 2024 at 20:18
… [Trackback]
[…] Find More on on that Topic: compdigitec.com/labs/2008/11/12/simple-timer-script-for-command-line-php/ […]
September 11th, 2024 at 00:45
… [Trackback]
[…] There you can find 3410 additional Info to that Topic: compdigitec.com/labs/2008/11/12/simple-timer-script-for-command-line-php/ […]
September 17th, 2024 at 01:08
… [Trackback]
[…] Information on that Topic: compdigitec.com/labs/2008/11/12/simple-timer-script-for-command-line-php/ […]