This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes HTML, CSS and JavaScript and the fly likes Making current thread sleep in JS for progress bar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Making current thread sleep in JS for progress bar" Watch "Making current thread sleep in JS for progress bar" New topic
Author

Making current thread sleep in JS for progress bar

sandeep Kumar
Ranch Hand

Joined: Sep 19, 2007
Posts: 41
Hi All,

I am using a Dojo SortableTable in my application.When I perform some search on one of the columns, datta will be populated from data base. During this elapsed time, A progress bar is shown.

The problem is after getting the data to the browser, it performs a parse on the data, this parsing takes lot of time during which the progress bar is just stable for considerable amount of time.

So I wanted to make current thread sleep in the parse function of JS during iterations. I hope during that sleep time, the CPU time would be given to the progress bar.

If any one has got some information, please suggest me.

Thanks in Advance.

Regards,
Sandeep.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61084
    
  66

JavaScript has no concept of threading.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
sandeep Kumar
Ranch Hand

Joined: Sep 19, 2007
Posts: 41
Hi Bear Bibeault,

First of all Thanks for your response.
But is there any way I could make my progress bar move during parsing?

Thanks/Sandeep.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61084
    
  66

When the script is busy doing one thing, all else is blocked.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Making current thread sleep in JS for progress bar