By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,903 Members | 2,075 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,903 IT Pros & Developers. It's quick & easy.

causing a ............. delay in the script

P: n/a
I have a script which uploads files to my site.
I limit file size and the files upload quickly
The a summary of what happens is

MESSAGE "Uploading bla bla bla file details bla bla bla
Script to transfer the files
MESSAGE "File uploaded sucessfully"

Because this happens so quickly the messags appear at the same time. I wish
to have a second delay between the first and second message. How do I insert
a delay into my script. This is purely cosmetic just to create the
impression that something is churning away uploading the file

Ian
Jun 27 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Ian Davies wrote:
Because this happens so quickly the messags appear at the same time.
I wish to have a second delay between the first and second message.
How do I insert a delay into my script. This is purely cosmetic just
to create the impression that something is churning away uploading
the file


http://www.php.net/sleep
JW
Jun 27 '06 #2

P: n/a
"Ian Davies" <ia********@virgin.net> wrote in message
news:C9*****************@newsfe6-win.ntli.net...
I have a script which uploads files to my site.
I limit file size and the files upload quickly
The a summary of what happens is

MESSAGE "Uploading bla bla bla file details bla bla bla
Script to transfer the files
MESSAGE "File uploaded sucessfully"

Because this happens so quickly the messags appear at the same time. I
wish
to have a second delay between the first and second message. How do I
insert
a delay into my script. This is purely cosmetic just to create the
impression that something is churning away uploading the file

This reminds me of a WTF published at thedailywtf.com some time ago:
http://thedailywtf.com/forums/thread/74323.aspx

Bascily this is what happened: customer doesn't believe an analysis could
run so and so fast and insisted that it's broken, so the programmer checks
the code just to see it in fact works correctly, so he adds a delay and a
dummy progress bar to the software to give the client an impression of
something happening. Later client complains it's now too slow, could they
perhaps optimize the code. Sure, the developer reduces the delay to a
shorter time and the company charges $5000 for "optimizing" the process.
Client happily pays and gets faster program. Everyone's happy!

--
"ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
sp**@outolempi.net | Gedoon-S @ IRCnet | rot13(xv***@bhgbyrzcv.arg)
Jun 27 '06 #3

P: n/a
In message <C9*****************@newsfe6-win.ntli.net>
"Ian Davies" <ia********@virgin.net> wrote:
I have a script which uploads files to my site.
I limit file size and the files upload quickly
The a summary of what happens is

MESSAGE "Uploading bla bla bla file details bla bla bla
Script to transfer the files
MESSAGE "File uploaded sucessfully"

Because this happens so quickly the messags appear at the same time. I wish
to have a second delay between the first and second message. How do I insert
a delay into my script. This is purely cosmetic just to create the
impression that something is churning away uploading the file

Ian


Could you not do a loop inbetween the messages, and just experiment
until you have a nice delay?

--
Kev Wells http://kevsoft.topcities.com
http://kevsoft.co.uk/
ICQ 238580561
Its nice to be important but Important to be nice.
Jun 27 '06 #4

P: n/a
Usually when a customer doesnt get it, it just means the message is not
clear. Just change the second message to say:

"After a long and tedious upload we have finally uploaded your file
succesfully. "

or if you dont want to be cynical just say:

"Uploading bla bla bla file details bla bla bla ....\nFile uploaded
succesfully".

This way it gives the illusion that the upload did something. It's all
about the message.

Or you can use sleep(n secs);

Ian Davies wrote:
I have a script which uploads files to my site.
I limit file size and the files upload quickly
The a summary of what happens is

MESSAGE "Uploading bla bla bla file details bla bla bla
Script to transfer the files
MESSAGE "File uploaded sucessfully"

Because this happens so quickly the messags appear at the same time. I wish
to have a second delay between the first and second message. How do I insert
a delay into my script. This is purely cosmetic just to create the
impression that something is churning away uploading the file

Ian


Jun 27 '06 #5

P: n/a
Just tried the sleep function it doesnt seem to work
code as follows

echo "$prog_msg";
sleep(1);
echo "$prog_msg2";

The two messages appear at the same time. am i using this function correctly
Thought it might not be long enough delay but same result with sleep(10);
Ian
"Janwillem Borleffs" <jw@jwscripts.com> wrote in message
news:44***********************@news.euronet.nl...
Ian Davies wrote:
Because this happens so quickly the messags appear at the same time.
I wish to have a second delay between the first and second message.
How do I insert a delay into my script. This is purely cosmetic just
to create the impression that something is churning away uploading
the file


http://www.php.net/sleep
JW

Jun 27 '06 #6

P: n/a
Rik
Ian Davies wrote:
Just tried the sleep function it doesnt seem to work
code as follows

echo "$prog_msg";
sleep(1);
echo "$prog_msg2";

The two messages appear at the same time. am i using this function
correctly Thought it might not be long enough delay but same result
with sleep(10); Ian


Perhaps:
echo "$prog_msg";
flush();
sleep(10);
echo "$prog_msg2";

If that doesn't work, look at the comments in
http://www.php.net/manual/en/function.flush.php

Grtz,
--
Rik Wasmus
Jun 27 '06 #7

P: n/a
Message-ID: <W9*****************@reader1.news.jippii.net> from Kimmo
Laine contained the following:
This reminds me of a WTF published at thedailywtf.com some time ago:
http://thedailywtf.com/forums/thread/74323.aspx

Bascily this is what happened: customer doesn't believe an analysis could
run so and so fast and insisted that it's broken, so the programmer checks
the code just to see it in fact works correctly, so he adds a delay and a
dummy progress bar to the software to give the client an impression of
something happening. Later client complains it's now too slow, could they
perhaps optimize the code. Sure, the developer reduces the delay to a
shorter time and the company charges $5000 for "optimizing" the process.
Client happily pays and gets faster program. Everyone's happy!


Tempting to put one of those in every script >:-)

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jun 27 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.