To show BABYLON.GUI during long calculation does not work

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 :rofl:

1 Like

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 :rofl: You can improve things by using Web workers: Using Web Workers - Web APIs | MDN ( to run heavy calculations on the background.

1 Like

@carolhmj @mawa
Thank you for your comments and suggestions.
I’ll try improve long cauclation with web workers :slight_smile: