Skip to content

Commit 0032f49

Browse files
authored
Merge pull request #720 from erickt/patch-1
Fix rand_jitter on older versions of rust
2 parents 267e19e + 7963440 commit 0032f49

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

rand_jitter/src/platform.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ pub fn get_nstime() -> u64 {
2121

2222
#[cfg(any(target_os = "macos", target_os = "ios"))]
2323
pub fn get_nstime() -> u64 {
24+
use libc;
25+
2426
// On Mac OS and iOS std::time::SystemTime only has 1000ns resolution.
2527
// We use `mach_absolute_time` instead. This provides a CPU dependent
2628
// unit, to get real nanoseconds the result should by multiplied by

0 commit comments

Comments
 (0)