display correct launch time

This commit is contained in:
🪞👃🪞 2024-10-26 22:01:48 +03:00
parent b4015a727a
commit 491ed81e83
3 changed files with 7 additions and 9 deletions

View file

@ -164,13 +164,13 @@ pub trait UsecPosition<U: TimeUnit> {
pub trait LaunchSync<U: TimeUnit> {
fn sync (&self) -> U;
fn set_sync (&self, sync: U);
#[inline] fn next_launch_sample (&self) -> U where U: TimeInteger, Self: PulsePosition<U> {
#[inline] fn next_launch_pulse (&self) -> U where U: TimeInteger, Self: PulsePosition<U> {
let sync = self.sync();
let pulse = self.pulse();
if pulse % sync == U::from(0) {
pulse
} else {
(pulse / sync) * sync + U::from(1)
(pulse / sync + U::from(1)) * sync
}
}
}