Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there some way to "nice" my JavaScript execution?

I'd like to run some calculations in a browser window, but I don't want it to slow the client computer down for user interaction, especially for single core machines. Is there some way to adjust the nice level of my executing JavaScript so that it will execute as fast as possible without detracting from the responsiveness of the machine?

like image 888
shino Avatar asked Apr 24 '10 08:04

shino


1 Answers

I can't think of anything else than delaying execution of your calculations. In example, dividing all work into small pieces and then running them sequentially with some delay (using setTimeout or setInterval) between each task.

like image 75
miensol Avatar answered Sep 27 '22 20:09

miensol