# To show BABYLON.GUI during long calculation does not work

**URL:** https://forum.babylonjs.com/t/to-show-babylon-gui-during-long-calculation-does-not-work/36815
**Category:** Questions
**Tags:** gui
**Created:** [December 23, 2022, 4:06am UTC](https://forum.babylonjs.com/t/to-show-babylon-gui-during-long-calculation-does-not-work/36815 "2022-12-23T04:06:51Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![akio-tanaka](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/akio-tanaka/32/28918_2.png) [@akio-tanaka](https://forum.babylonjs.com/u/akio-tanaka)
#### Post date: [December 23, 2022, 4:06am UTC](https://forum.babylonjs.com/t/to-show-babylon-gui-during-long-calculation-does-not-work/36815/1 "2022-12-23T04:06:52Z")

</div>

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.

[Playground](https://www.babylonjs-playground.com/#XCPP9Y#16946)

---

<div class="post-metadata">

### Author: ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)
#### Post date: [December 23, 2022, 12:43pm UTC](https://forum.babylonjs.com/t/to-show-babylon-gui-during-long-calculation-does-not-work/36815/2 "2022-12-23T12:43:39Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)
#### Post date: [December 23, 2022, 1:00pm UTC](https://forum.babylonjs.com/t/to-show-babylon-gui-during-long-calculation-does-not-work/36815/3 "2022-12-23T13:00:53Z")

</div>

@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 🤣

---

<div class="post-metadata">

### Author: ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)
#### Post date: [December 23, 2022, 1:22pm UTC](https://forum.babylonjs.com/t/to-show-babylon-gui-during-long-calculation-does-not-work/36815/4 "2022-12-23T13:22:24Z")

</div>

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)](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers) to run heavy calculations on the background.

---

<div class="post-metadata">

### Author: ![akio-tanaka](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/akio-tanaka/32/28918_2.png) [@akio-tanaka](https://forum.babylonjs.com/u/akio-tanaka)
#### Post date: [December 23, 2022, 9:57pm UTC](https://forum.babylonjs.com/t/to-show-babylon-gui-during-long-calculation-does-not-work/36815/5 "2022-12-23T21:57:01Z")

</div>

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