Real
Real
- startup : bevy_utils::Instant
- first_update : core::option::Option<bevy_utils::Instant>
- last_update : core::option::Option<bevy_utils::Instant>
Description
Real time clock representing elapsed wall clock time.
A specialization of the [
Time
] structure. For method documentation, see [Time<Real>#impl-Time<Real>
].It is automatically inserted as a resource by
TimePlugin
and updated with time instants according toTimeUpdateStrategy
.1Note: Using
TimeUpdateStrategy::ManualDuration
allows for mocking the wall clock for testing purposes. Besides this use case, it is not recommended to do this, as it will no longer represent "wall clock" time as intended.The
delta()
andelapsed()
values of this clock should be used for anything which deals specifically with real time (wall clock time). It will not be affected by relative game speed adjustments, pausing or other adjustments.1The clock does not count time from
startup()
tofirst_update()
into elapsed, but instead will start counting time from the first update call.delta()
andelapsed()
will report zero on the first update as there is no previous update instant. This means that adelta()
of zero must be handled without errors in application logic, as it may theoretically also happen at other times.[
Instant
]s forstartup()
,first_update()
andlast_update()
are recorded and accessible.1When using
TimeUpdateStrategy::ManualDuration
, [Time<Real>#impl-Time<Real>
] is only a mock of wall clock time.
Functions
Function | Summary |
---|---|
clone(_self) | No Documentation 🚧 |