Function get_main_loop_timing

Source
pub fn get_main_loop_timing() -> Result<MainLoopTiming, MainLoopInvalidTiming>
Expand description

Returns the main loop timing parameters of the main loop.

If the parameters have an invalid mode, an error with the found parameters is returned instead.

ยงExamples

match get_main_loop_timing() {
    Ok(MainLoopTiming::SetTimeout(ms)) => {
        println!("It runs every {} ms", ms);
    }
    Ok(MainLoopTiming::RequestAnimationFrame(_)) => {
        println!("You render stuff as you should");
    }
    Ok(MainLoopTiming::SetImmediate) => {
        println!("Why are you doing this???");
    }
    Err(err) => {
        println!("What??? {}", err);
    }
};