#Fps drops by half when resizing wasm

2 messages · Page 1 of 1 (latest)

latent adder
#

On startup my app runs stuck at the vsync rate of 120 which is expected, however after resizing the window it drops down to 50, fluctuating wildly to 90 for some reason.
I'm wondering if this is intended behavior, since I know wasm has a lot of quirks.

#

FPS calculator, running on Update:

    data.frames += 1;

    if data.last_update.elapsed() < Duration::from_secs(1) {
        // No update
        return;
    }

    query
        .get_mut(*data.entity.as_ref().unwrap())
        .unwrap()
        .sections
        .get_mut(0)
        .unwrap()
        .value = format!(
        "FPS: {:.00}",
        data.frames as f32 / data.last_update.elapsed().as_secs_f32()
    );

    data.last_update = Instant::now();
    data.frames = 0;
}