sleep question

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
peter986532
Forum Newbie
Posts: 6
Joined: Wed Dec 30, 2009 9:38 pm

sleep question

Post by peter986532 »

lol this may be a really noob question, but when i put:

Code: Select all

<?php
echo date('h:i:s');
sleep(15);
echo '<br>';
echo date('h:i:s');
?>  
I just get

Code: Select all

10:43:27
10:43:27  
Am I missing something or should it be doing that?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: sleep question

Post by requinix »

And it does that every time you run it? And what you posted is exactly the same code?
peter986532
Forum Newbie
Posts: 6
Joined: Wed Dec 30, 2009 9:38 pm

Re: sleep question

Post by peter986532 »

yes and yes
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Re: sleep question

Post by daedalus__ »

why do you need it? it can make it easier to put your server out

by the way it worked fine on my local machine
peter986532
Forum Newbie
Posts: 6
Joined: Wed Dec 30, 2009 9:38 pm

Re: sleep question

Post by peter986532 »

Ohhhh ok,
The server had it disabled under
disable_functions

Is there a way around this?
peter986532
Forum Newbie
Posts: 6
Joined: Wed Dec 30, 2009 9:38 pm

Re: sleep question

Post by peter986532 »

hahaha nvm I just used usleep
Post Reply