@@ -84,6 +84,7 @@ impl Time<Fixed> {
84
84
85
85
/// Returns the amount of virtual time that must pass before the fixed
86
86
/// timestep schedule is run again.
87
+ #[ inline]
87
88
pub fn timestep ( & self ) -> Duration {
88
89
self . context ( ) . timestep
89
90
}
@@ -93,6 +94,7 @@ impl Time<Fixed> {
93
94
///
94
95
/// Takes effect immediately on the next run of the schedule, respecting
95
96
/// what is currently in [`Self::overstep`].
97
+ #[ inline]
96
98
pub fn set_timestep ( & mut self , timestep : Duration ) {
97
99
assert_ne ! (
98
100
timestep,
@@ -111,6 +113,7 @@ impl Time<Fixed> {
111
113
///
112
114
/// Takes effect immediately on the next run of the schedule, respecting
113
115
/// what is currently in [`Self::overstep`].
116
+ #[ inline]
114
117
pub fn set_timestep_seconds ( & mut self , seconds : f64 ) {
115
118
assert ! (
116
119
seconds. is_sign_positive( ) ,
@@ -128,6 +131,7 @@ impl Time<Fixed> {
128
131
///
129
132
/// Takes effect immediately on the next run of the schedule, respecting
130
133
/// what is currently in [`Self::overstep`].
134
+ #[ inline]
131
135
pub fn set_timestep_hz ( & mut self , hz : f64 ) {
132
136
assert ! ( hz. is_sign_positive( ) , "Hz less than or equal to zero" ) ;
133
137
assert ! ( hz. is_finite( ) , "Hz is infinite" ) ;
@@ -136,18 +140,21 @@ impl Time<Fixed> {
136
140
137
141
/// Returns the amount of overstep time accumulated toward new steps, as
138
142
/// [`Duration`](std::time::Duration).
143
+ #[ inline]
139
144
pub fn overstep ( & self ) -> Duration {
140
145
self . context ( ) . overstep
141
146
}
142
147
143
148
/// Returns the amount of overstep time accumulated toward new steps, as an
144
149
/// [`f32`] fraction of the timestep.
150
+ #[ inline]
145
151
pub fn overstep_percentage ( & self ) -> f32 {
146
152
self . context ( ) . overstep . as_secs_f32 ( ) / self . context ( ) . timestep . as_secs_f32 ( )
147
153
}
148
154
149
155
/// Returns the amount of overstep time accumulated toward new steps, as an
150
156
/// [`f64`] fraction of the timestep.
157
+ #[ inline]
151
158
pub fn overstep_percentage_f64 ( & self ) -> f64 {
152
159
self . context ( ) . overstep . as_secs_f64 ( ) / self . context ( ) . timestep . as_secs_f64 ( )
153
160
}
0 commit comments