rename methods
This commit is contained in:
parent
d029f651fa
commit
a7549108a8
@ -22,6 +22,10 @@ impl Duration {
|
|||||||
self.ticks * 1000 / TICKS_PER_SECOND
|
self.ticks * 1000 / TICKS_PER_SECOND
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub const fn as_micros(&self) -> u64 {
|
||||||
|
self.ticks * 1_000_000 / TICKS_PER_SECOND
|
||||||
|
}
|
||||||
|
|
||||||
pub const fn from_ticks(ticks: u64) -> Duration {
|
pub const fn from_ticks(ticks: u64) -> Duration {
|
||||||
Duration { ticks }
|
Duration { ticks }
|
||||||
}
|
}
|
||||||
@ -41,7 +45,7 @@ impl Duration {
|
|||||||
/*
|
/*
|
||||||
NOTE: us delays may not be as accurate
|
NOTE: us delays may not be as accurate
|
||||||
*/
|
*/
|
||||||
pub const fn from_us(millis: u64) -> Duration {
|
pub const fn from_micros(millis: u64) -> Duration {
|
||||||
Duration {
|
Duration {
|
||||||
ticks: millis * TICKS_PER_SECOND / 1_000_000,
|
ticks: millis * TICKS_PER_SECOND / 1_000_000,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user