mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-22 06:42:32 +00:00
time: some const fns
This commit is contained in:
parent
ec4b95579d
commit
a2e73cb549
@ -8,7 +8,7 @@ pub struct Duration {
|
||||
}
|
||||
|
||||
impl Duration {
|
||||
pub fn into_ticks(&self) -> u32 {
|
||||
pub const fn into_ticks(&self) -> u32 {
|
||||
self.ticks
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,11 @@ impl Instant {
|
||||
Instant { ticks: now() }
|
||||
}
|
||||
|
||||
pub fn into_ticks(&self) -> u64 {
|
||||
pub const fn from_ticks(ticks: u64) -> Self {
|
||||
Self { ticks }
|
||||
}
|
||||
|
||||
pub const fn into_ticks(&self) -> u64 {
|
||||
self.ticks
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user