I am trying to show some GUI parts during long calculation in front end. The code of the following code in Playgound is simplified one, and it does not work.
I would appreciate any comments or suggestion.
I am trying to show some GUI parts during long calculation in front end. The code of the following code in Playgound is simplified one, and it does not work.
I would appreciate any comments or suggestion.
Hello and welcome to the Babylon community!
Can you explain a bit more what does not work? Do you want to hide the GUI immediately when the long calculation button is pressed?
@carolhmj I believe it’s about the GUI not responding while the calculation is in process. However, I tried to open the console during the calculation and it is chrome not responding. Although, I think I know the GUI does not refresh at the same rate (correct?), I don’t think it would change anything here to push it, would it? Honestly, I don’t know, I never make long calc; My math skills are even lower than those claimed by pirateJC
Yeah, since javascript is single-threaded if you do a big calculation it’s going to not just block the GUI, it will block everything You can improve things by using Web workers: Using Web Workers - Web APIs | MDN (mozilla.org) to run heavy calculations on the background.