37

Thread.sleep(4000);
// to make it look like it's processing

Comments
  • 1
    Because it's so blazing quick!
  • 1
    @jirehstudios 😂 it's also developer friendly
  • 2
    Had an issue with a queue processing service that was picking up requests too quickly. The SQL server hadn't finished committing the transaction data, so when the queue processor ran no work was actually done. We put a 5 second delay on trying to read the data.
  • 2
    I think we're moving more in to a world where we use callbacks on asynchronous tasks to handle this now. but I have to admit I did use it a few years ago. just because I wanted people to see my nice splash screen
  • 3
    Later reduce it to 2000 to make them think you made it faster when you were actually looking at devRant
  • 2
    True story. I wrote an implementation that fetches some feed data and processes it. I added a loading animation for those few moments where something happens, but in general it was almost instantaneous.

    So I get a complaint from a user. "I can't see the loading animation." I finally had to add a 2 second wait on my demo version just so they could see the loading animation. -.-
  • 1
    So true :D I use PHP's sleep(..) in almost every project that has an UI.. Just so that the user can see the awesome 'ajax-loader.gif' I use amd like you said.. to make it look like it's processing :D
Add Comment