# How to avoid sleep overhead when loading the master bank/master string bank

**URL:** <https://qa.fmod.com/t/how-to-avoid-sleep-overhead-when-loading-the-master-bank-master-string-bank/19431>\
**Category:** Unity\
**Tags:** android, unity, csharp\
**Created:** [October 20, 2022, 1:50pm UTC](https://qa.fmod.com/t/how-to-avoid-sleep-overhead-when-loading-the-master-bank-master-string-bank/19431 "2022-10-20T13:50:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RiddleC](https://avatars.discourse-cdn.com/v4/letter/r/b2d939/32.png) [@RiddleC](https://qa.fmod.com/u/RiddleC)\
**Post date:** [October 20, 2022, 1:50pm UTC](https://qa.fmod.com/t/how-to-avoid-sleep-overhead-when-loading-the-master-bank-master-string-bank/19431/1 "2022-10-20T13:50:37Z")

</div>

In my project, loadBankCustom is used to load banks.  
When loading the master bank in the process of initializing the FMOD Env，I setted the bank to load synchronously. And then I noticed that there was a sleep overhead of several hundred milliseconds. This results in a time-consuming process for initialization. May I ask what sleep does here? Is there any way to avoid this cost?  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/6/6121ef2e60cddf25ac46fbd5c8d5b639ece3e85c.png)

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [October 24, 2022, 11:04pm UTC](https://qa.fmod.com/t/how-to-avoid-sleep-overhead-when-loading-the-master-bank-master-string-bank/19431/2 "2022-10-24T23:04:26Z")

</div>

Hi,

As you have specified you are loading synchronously, the main thread will sleep until the bank load thread is done. If you want to avoid the sleep you could load banks asynchronously, and monitor for when bank load is complete with `Bank.getLoadState`. A further explanantion can be found under [FMOD API | Studio API](https://fmod.com/docs/2.02/api/studio-api-bank.html#studio_bank_getloadingstate).

Hope this helps!

---

<div class="post-metadata">

**Author:** ![RiddleC](https://avatars.discourse-cdn.com/v4/letter/r/b2d939/32.png) [@RiddleC](https://qa.fmod.com/u/RiddleC)\
**Post date:** [October 27, 2022, 2:09am UTC](https://qa.fmod.com/t/how-to-avoid-sleep-overhead-when-loading-the-master-bank-master-string-bank/19431/3 "2022-10-27T02:09:47Z")

</div>

Thank you for your reply.  
Of course asynchronously loading will be helpful.  
I want to know why the sleep always costs Hundreds of milliseconds when we are loading synchronously.  
According to the observation, the loading porcess will not cost that much.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [November 1, 2022, 11:32pm UTC](https://qa.fmod.com/t/how-to-avoid-sleep-overhead-when-loading-the-master-bank-master-string-bank/19431/4 "2022-11-01T23:32:12Z")

</div>

Is it possible to get a code snippet of how you are loading the banks with loadBankCustom?
