Tainted\\Coders

Log FPS to console

Bevy version: 0.18Last updated:

Use FrameTimeDiagnosticsPlugin to add the information to the diagnostics.

Use LogDiagnosticsPlugin to output the diagnostics to the console. You can use bevy::diagnostic::* for some built in diagnostics info to be added.

Each of these plugins will enhance your console with detailed debug information.

use bevy::app::App;
use bevy::asset::{Texture, diagnostic::AssetCountDiagnosticsPlugin};
use bevy::diagnostic::{
    EntityCountDiagnosticsPlugin, FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin,
    SystemInformationDiagnosticsPlugin,
};

pub(crate) fn plugin(app: &mut App) {
    app.add_plugins((
        LogDiagnosticsPlugin::default(),
        FrameTimeDiagnosticsPlugin::default(),
        EntityCountDiagnosticsPlugin::default(),
        AssetCountDiagnosticsPlugin::<Texture>::default(),
        SystemInformationDiagnosticsPlugin::default(),
    ));
}