Skip to content

Commit e05a199

Browse files
committed
Added additional constructor from millis for 'Delay'
1 parent cc8e4a5 commit e05a199

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/header/delays.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ impl Delay {
2828
Delay(value)
2929
}
3030

31+
pub const fn new_from_millis(value: u64) -> Self {
32+
const NANOS_PER_MILLI: u64 = 1_000_000;
33+
34+
Self::new_from_nanos(NANOS_PER_MILLI * value)
35+
}
36+
3137
pub fn to_nanos(&self) -> u64 {
3238
self.0
3339
}

0 commit comments

Comments
 (0)