time: some const fns
This commit is contained in:
parent
ec4b95579d
commit
a2e73cb549
2 changed files with 6 additions and 2 deletions
|
@ -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 a new issue