Skip to content

Commit abacde6

Browse files
alexcrichtonischeinkman
authored andcommitted
Increase Duration approximate equal threshold to 1us
Previously this threshold when testing was 100ns, but the Windows documentation states: > which is a high resolution (<1us) time stamp which presumably means that we could have up to 1us resolution, which means that 100ns doesn't capture "equivalent" time intervals due to various bits of rounding here and there. It's hoped that this.. Closes rust-lang#56034
1 parent 3bdf23e commit abacde6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/time.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ mod tests {
489489
let (a, b) = ($a, $b);
490490
if a != b {
491491
let (a, b) = if a > b {(a, b)} else {(b, a)};
492-
assert!(a - Duration::new(0, 100) <= b,
492+
assert!(a - Duration::new(0, 1000) <= b,
493493
"{:?} is not almost equal to {:?}", a, b);
494494
}
495495
})

0 commit comments

Comments
 (0)