I'm benchmarking some threading code, whose code executed is just filler.
What's the simplest code I can use as filler, that is not optimized away in release mode?
As far as I can see, operations need to have a side effect (e.g. assignment to a variable), and if I'm assigning to a variable, the variable needs to be used.
Right now, I'm using something like:
let mut acc = 1_f64;
for ... {
// blah
acc += acc.sqrt();
}
if acc < 1.0 {
println!("");
}
Is there any simpler way?