build in php timeout or pause function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
psychotomus
Forum Contributor
Posts: 487
Joined: Fri Jul 11, 2003 1:59 am

build in php timeout or pause function

Post by psychotomus »

does php have a built in timeout or pause function?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

yes.
User avatar
sweatje
Forum Contributor
Posts: 277
Joined: Wed Jun 29, 2005 10:04 pm
Location: Iowa, USA

Post by sweatje »

psychotomus
Forum Contributor
Posts: 487
Joined: Fri Jul 11, 2003 1:59 am

Post by psychotomus »

Code: Select all

if ( $_POST['exploring'] > 0 )
{
	for ($i=0;$i < $_POST['exploring']; $i++)
	{
		print 'you have explored an acre of land.<br>';
		flush();
		sleep(1);

	}

}
anybody know how come this wont show "you have explored an ancre of land" then pause for a second and show it again? or know any other ways to do this with just php.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

the web server may choose to buffer your output despite your wish to not buffer it.
Post Reply