1
0
forked from ROMEO/nexosim

Overload schedule_*event methods

The `schedule_*event_in` and `schedule_*event_at` pairs of methods are
each merged into a single overloaded method accepting either a relative
`Duration`or an absolute `MonotonicTime`.
This commit is contained in:
Serge Barral
2023-08-14 15:47:08 +02:00
parent a036630c4e
commit 22516fe190
9 changed files with 132 additions and 418 deletions

View File

@ -88,7 +88,7 @@ pub struct DelayedMultiplier {
impl DelayedMultiplier {
pub fn input(&mut self, value: f64, scheduler: &Scheduler<Self>) {
scheduler
.schedule_event_in(Duration::from_secs(1), Self::send, 2.0 * value)
.schedule_event(Duration::from_secs(1), Self::send, 2.0 * value)
.unwrap();
}
async fn send(&mut self, value: f64) {