dsdsdsdsd Posted March 24, 2008 Share Posted March 24, 2008 hello; javascript and actionscript both have set_interval type of functions, such as: var my_interval = setTimeout( a_function , number_of_milliseconds , my_argument_list ) does php have something similar; I have come across 'curl' functions, though I am not certain if my php ( and my webhost's ) has the curl extension, so I am hoping that php has something more naturally inherent; thanks dsdsdsdsd Link to comment https://forums.phpfreaks.com/topic/97647-does-php-have-intervaltimeout-capabilities/ Share on other sites More sharing options...
cooldude832 Posted March 24, 2008 Share Posted March 24, 2008 why would u need php to take a timeout? Link to comment https://forums.phpfreaks.com/topic/97647-does-php-have-intervaltimeout-capabilities/#findComment-499605 Share on other sites More sharing options...
rhodesa Posted March 24, 2008 Share Posted March 24, 2008 There are sleep() and usleep() functions. But they will just pause the script while it is loading. Are you talking about loading a page completely, and after it loads running another PHP script/function/command later? Link to comment https://forums.phpfreaks.com/topic/97647-does-php-have-intervaltimeout-capabilities/#findComment-499607 Share on other sites More sharing options...
dsdsdsdsd Posted March 24, 2008 Author Share Posted March 24, 2008 hello rhodesa and cooldude832; this question is in conjunction with another question regarding the question: 'can php ping client-side apps'; by the way, 'timeout' is a mis-nomer ( javascript uses the term ); really a time-based interval is what I am interested in, so that I can perform a function ( ie, a ping function ) every 85 milliseconds; thanks dsdsdsdsd Link to comment https://forums.phpfreaks.com/topic/97647-does-php-have-intervaltimeout-capabilities/#findComment-499643 Share on other sites More sharing options...
cooldude832 Posted March 24, 2008 Share Posted March 24, 2008 like I said on your other thread php can't self activate nor can it run concurrently it needs to be activated via cron or a user pointing to it Link to comment https://forums.phpfreaks.com/topic/97647-does-php-have-intervaltimeout-capabilities/#findComment-499648 Share on other sites More sharing options...
dsdsdsdsd Posted March 24, 2008 Author Share Posted March 24, 2008 I will look into cron; thanks dsdsdsdsd Link to comment https://forums.phpfreaks.com/topic/97647-does-php-have-intervaltimeout-capabilities/#findComment-499653 Share on other sites More sharing options...
rhodesa Posted March 24, 2008 Share Posted March 24, 2008 UPDATE: Ignore this...I missed the "client side app" portion... right, but you could do something like: <?php $host = "www.hostname.com"; while(1){ passthru("ping -n 1 $host"); usleep(85000); } ?> When run, it will continually ping/wait 85 milliseconds until you cancel the script Link to comment https://forums.phpfreaks.com/topic/97647-does-php-have-intervaltimeout-capabilities/#findComment-499659 Share on other sites More sharing options...
lordfrikk Posted March 24, 2008 Share Posted March 24, 2008 You will probably have to use AJAX to be able to activate your script every x seconds. Link to comment https://forums.phpfreaks.com/topic/97647-does-php-have-intervaltimeout-capabilities/#findComment-499660 Share on other sites More sharing options...
cooldude832 Posted March 24, 2008 Share Posted March 24, 2008 UPDATE: Ignore this...I missed the "client side app" portion... right, but you could do something like: <?php $host = "www.hostname.com"; while(1){ passthru("ping -n 1 $host"); usleep(85000); } ?> Your host company will probably shut u done for that, not to mention you can get cron to run every 30 minutes or faster if need be When run, it will continually ping/wait 85 milliseconds until you cancel the script Link to comment https://forums.phpfreaks.com/topic/97647-does-php-have-intervaltimeout-capabilities/#findComment-499666 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.