Skip to content

Commit 6a20535

Browse files
amatgilkaikalii
authored andcommitted
Seed from time properly
1 parent 0015f2b commit 6a20535

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/run_prim.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,8 +1787,7 @@ fn undo_regex(env: &mut Uiua) -> UiuaResult {
17871787
}
17881788

17891789
thread_local! {
1790-
pub(crate) static RNG: RefCell<Xoshiro256Plus> = RefCell::new(Xoshiro256Plus::seed_from_u64(
1791-
SystemTime::now().duration_since(UNIX_EPOCH).map(|t|t.as_micros()).unwrap_or(42) as u64));
1790+
pub(crate) static RNG: RefCell<Xoshiro256Plus> = RefCell::new(Xoshiro256Plus::seed_from_u64(f64::to_bits(crate::now())))
17921791
}
17931792

17941793
/// Generate a random number, equivalent to [`Primitive::Rand`]

0 commit comments

Comments
 (0)