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 to TimeUpdateStrategy.1

Note: 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() and elapsed() 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.1

The clock does not count time from startup() to first_update() into elapsed, but instead will start counting time from the first update call. delta() and elapsed() will report zero on the first update as there is no previous update instant. This means that a delta() of zero must be handled without errors in application logic, as it may theoretically also happen at other times.

[Instant]s for startup(), first_update() and last_update() are recorded and accessible.

1

When using TimeUpdateStrategy::ManualDuration, [Time<Real>#impl-Time<Real>] is only a mock of wall clock time.

Functions

FunctionSummary
clone(_self)No Documentation 🚧