Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added docs about MinimalPlugins looping as fast as possible. #17241

Merged
merged 5 commits into from
Jan 9, 2025
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions crates/bevy_internal/src/default_plugins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,17 @@ plugin_group! {
/// It includes a [schedule runner (`ScheduleRunnerPlugin`)](crate::app::ScheduleRunnerPlugin)
/// to provide functionality that would otherwise be driven by a windowed application's
/// *event loop* or *message loop*.
///
/// By default, this loop will run as fast as possible, which can result in high CPU usage.
AlephCubed marked this conversation as resolved.
Show resolved Hide resolved
/// You can add a delay using [`run_loop`](crate::app::ScheduleRunnerPlugin::run_loop),
/// or remove the loop using [`run_once`](crate::app::ScheduleRunnerPlugin::run_once).
/// # Example:
/// ```rust
/// # use std::time::Duration;
/// # use bevy_app::{App, PluginGroup, ScheduleRunnerPlugin};
/// # use bevy_internal::MinimalPlugins;
/// App::new().add_plugins(MinimalPlugins.set(ScheduleRunnerPlugin::run_loop(
/// // Run 60 times per second.
/// Duration::from_secs_f64(1.0 / 60.0),
/// ))).run();
}
Loading