#![doc = include_str!("../README.md")] #![cfg_attr(docsrs, feature(doc_auto_cfg))] #![forbid(unsafe_code)] #![doc( html_logo_url = "https://bevyengine.org/assets/icon.png", html_favicon_url = "https://bevyengine.org/assets/icon.png" )] /// Common run conditions pub mod common_conditions; mod fixed; mod real; mod stopwatch; #[allow(clippy::module_inception)] mod time; mod timer; mod virt; pub use fixed::*; pub use real::*; pub use stopwatch::*; pub use time::*; pub use timer::*; pub use virt::*; pub mod prelude { //! The Bevy Time Prelude. #[doc(hidden)] pub use crate::{Fixed, Real, Time, Timer, TimerMode, Virtual}; } use bevy_app::{prelude::*, RunFixedMainLoop}; use bevy_ecs::event::{ event_update_system, signal_event_update_system, EventRegistry, ShouldUpdateEvents, }; use bevy_ecs::prelude::*; use bevy_utils::{tracing::warn, Duration, Instant}; pub use crossbeam_channel::TrySendError; use crossbeam_channel::{Receiver, Sender}; /// Adds time functionality to Apps. #[derive(Default)] pub struct TimePlugin; #[derive(Debug, PartialEq, Eq, Clone, Hash, SystemSet)] /// Updates the elapsed time. Any system that interacts with [`Time`] component should run after /// this. pub struct TimeSystem; impl Plugin for TimePlugin { fn build(&self, app: &mut App) { app.init_resource::