# How and when to call studio.system.update

**URL:** <https://qa.fmod.com/t/how-and-when-to-call-studio-system-update/15087>\
**Category:** Unity\
**Created:** [September 30, 2019, 5:10pm UTC](https://qa.fmod.com/t/how-and-when-to-call-studio-system-update/15087 "2019-09-30T17:10:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lewisaudio](https://avatars.discourse-cdn.com/v4/letter/l/fbc32d/32.png) [@lewisaudio](https://qa.fmod.com/u/lewisaudio)\
**Post date:** [September 30, 2019, 5:10pm UTC](https://qa.fmod.com/t/how-and-when-to-call-studio-system-update/15087/1 "2019-09-30T17:10:07Z")

</div>

Hi there. I’m just wondering how and when I should be calling the studio.system.update function? I think it may help an issue that I’ve got with a game I’ve been working. I have not used any of the studio.system functions before and just wondering if any one could break it right down for me… All the way down.

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [October 6, 2019, 10:12pm UTC](https://qa.fmod.com/t/how-and-when-to-call-studio-system-update/15087/2 "2019-10-06T22:12:18Z")

</div>

There is a section on [Update](https://www.fmod.com/resources/documentation-api?version=2.0&page=white-papers-getting-started.html#update) in the [Getting Started](https://www.fmod.com/resources/documentation-api?version=2.0&page=white-papers-getting-started.html) section of the [White Papers](https://www.fmod.com/resources/documentation-api?version=2.0&page=white-papers.html).

> FMOD should be ticked once per game update. When using FMOD Studio, call [Studio::System::update](https://www.fmod.com/resources/documentation-api?version=2.0&page=studio-api-system.html#studio_system_update), which internally will also update the Core system. If using Core directly, instead call [System::update](https://www.fmod.com/resources/documentation-api?version=2.0&page=core-api-system.html#system_update).
> 
> If FMOD Studio is running in asynchronous mode (the default, unless [FMOD\_STUDIO\_INIT\_SYNCHRONOUS\_UPDATE](https://www.fmod.com/resources/documentation-api?version=2.0&page=studio-api-system.html#fmod_studio_init_synchronous_update) has been specified), then the [Studio::System::update](https://www.fmod.com/resources/documentation-api?version=2.0&page=studio-api-system.html#studio_system_update) will be extremely quick as it is merely swapping a buffer for the asynchronous execution of that frame’s commands.

---

<div class="post-metadata">

**Author:** ![tlconflict](https://avatars.discourse-cdn.com/v4/letter/t/4491bb/32.png) [@tlconflict](https://qa.fmod.com/u/tlconflict)\
**Post date:** [December 20, 2023, 5:35pm UTC](https://qa.fmod.com/t/how-and-when-to-call-studio-system-update/15087/3 "2023-12-20T17:35:12Z")

</div>

```rs
const dt = 0.0;

let mut t = 0.0;
let mut current_time = std::time::Instant::now();
let mut accumulator = 0.0;

let mut prev: State = State::new();
let mut curr: State = State::new();

loop {
    let new_time = std::time::Instant::now();
    let mut frame_time = new_time.from(current_time).as_nanos / 1000000000; // from ns to s
    if frame_time > 0.25 { // where did this constant come from?
        frame_time = 0.25;
    }
    current_time = new_time;

    accumulator += frame__time;

    while accumulator >= dt {
        prev = curr;
        update(curr, t, dt);
        accumulator -= dt;
        t += dt;
    }

    let alpha = accumulator / dt;
    let state: State = curr * alpha + prev * (1.0 - alpha);

    render(state); // render state should match physics state
}

```

But what if your gameupdate runs at a fixed rate(for deterministic physics, etc)? e.g sim at 30 fps while your rendering runs at 60-whatever monitor refresh rate? Do you still call `studio.system.update` in the fixed game update? Or do you move it out to where the render() is called?

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [December 27, 2023, 5:33am UTC](https://qa.fmod.com/t/how-and-when-to-call-studio-system-update/15087/4 "2023-12-27T05:33:37Z")

</div>

I doubt it would make any obvious difference in either case. I think it makes more sense to call it during the game update instead of the rendering update, just to keep FMOD’s state in sync with your game’s state as much as possible.
