Skip to content

Commit debc7d9

Browse files
committed
Speed up example
1 parent 09662b6 commit debc7d9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/streams.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,9 @@ fn thrifty_rand() -> u8 {
176176
+ 1
177177
}
178178

179+
const MAGIC: u64 = 11;
179180
fn random_wait_millis(slowness: u8) -> u64 {
180-
thrifty_rand() as u64 * thrifty_rand() as u64 * 35 * slowness as u64
181+
thrifty_rand() as u64 * thrifty_rand() as u64 * MAGIC * slowness as u64
181182
}
182183

183184
/// Generate a potentially unique value.

0 commit comments

Comments
 (0)