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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ian Davies

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

    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


  • Janwillem Borleffs

    #2
    Re: causing a ............. delay in the script

    Ian Davies wrote:[color=blue]
    > 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
    >[/color]




    JW


    Comment

    • Kimmo Laine

      #3
      Re: causing a ............. delay in the script

      "Ian Davies" <iandan.dav@vir gin.net> wrote in message
      news:C98og.2002 0$OT.3968@newsf e6-win.ntli.net...[color=blue]
      >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[/color]


      This reminds me of a WTF published at thedailywtf.com some time ago:
      I'll just step aside today and let Jeremy H share one of his WTF moments, It Must Be Broken ... At my previous job, I worked on a team that built automated scanning systems.  The software controlled a motor that moved the scanning head over the piece of material, took data points in a grid pattern, and fed the results into the data acquisition module of the software.


      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
      spam@outolempi. net | Gedoon-S @ IRCnet | rot13(xvzzb@bhg byrzcv.arg)


      Comment

      • Kevin Wells

        #4
        Re: causing a ............. delay in the script

        In message <C98og.20020$OT .3968@newsfe6-win.ntli.net>
        "Ian Davies" <iandan.dav@vir gin.net> wrote:
        [color=blue]
        >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
        >
        >[/color]

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

        --
        Kev Wells http://kevsoft.topcities.com

        ICQ 238580561
        Its nice to be important but Important to be nice.

        Comment

        • ImOk

          #5
          Re: causing a ............. delay in the script

          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:[color=blue]
          > 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[/color]

          Comment

          • Ian Davies

            #6
            Re: causing a ............. delay in the script

            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.c om> wrote in message
            news:44a11688$0 $79754$dbd4d001 @news.euronet.n l...[color=blue]
            > Ian Davies wrote:[color=green]
            > > 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
            > >[/color]
            >
            > http://www.php.net/sleep
            >
            >
            > JW
            >
            >[/color]


            Comment

            • Rik

              #7
              Re: causing a ............. delay in the script

              Ian Davies wrote:[color=blue]
              > 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[/color]

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

              If that doesn't work, look at the comments in


              Grtz,
              --
              Rik Wasmus


              Comment

              • Geoff Berrow

                #8
                Re: causing a ............. delay in the script

                Message-ID: <W99og.10029$6m 5.627@reader1.n ews.jippii.net> from Kimmo
                Laine contained the following:
                [color=blue]
                >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![/color]

                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/

                Comment

                Working...