Fix NaN during first round issue in the iterative hash example.

This commit is contained in:
losfair 2019-08-15 19:12:32 -07:00
parent 6a24485999
commit 8a1f399df6

View File

@ -14,7 +14,7 @@ fn main() {
let out = hasher.result();
data = out.to_vec();
if i % 100000 == 0 {
if i != 0 && i % 100000 == 0 {
let millis = now.elapsed().unwrap().as_millis();
println!("{} rounds in last second", (i - round_count) as f64 / (millis - last_millis) as f64);
last_millis = millis;