Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Sleep - settle an argument?

by flexvault (Parson)
on Sep 20, 2012 at 19:21 UTC ( #994739=note: print w/ replies, xml ) Need Help??


in reply to Sleep - settle an argument?

ultranerds,

I have used the Javascript 'setTimeout()' function to do something similar to 'sleep()'.

Works Great.

"Well done is better than well said." - Benjamin Franklin


Comment on Re: Sleep - settle an argument?
OT Re^2: Sleep - settle an argument?
by bulk88 (Priest) on Sep 20, 2012 at 23:32 UTC
    I've used setTimeout to fix "multithreading" bugs in non-web JS using apps. The screen wouldn't draw while the script ran, the GUI elements created, the options they were created with (text field) were all blank on reads even though I passed an initial value when I created the GUI element. Doing a setTimeout allowed the GUI objects to set themselves up.

      bulk88,

      Great! I answered to let other monks know that there was something similar to sleep() in JS.

      I use it to update a digital clock on a CRM package. Twice a second, it updates the clock. Before I used the setTimeout, the user's PC was totally overloaded with calls to the clock update routine and there was no cpu power left for other things (like input) :-)

      Thanks...Ed

      "Well done is better than well said." - Benjamin Franklin

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://994739]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (14)
As of 2014-12-29 13:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (188 votes), past polls