Testing 32 bit writes using safe method vs unsafe method
()
| 124 | |
| 125 | // Testing 32 bit writes using safe method vs unsafe method |
| 126 | fn trial_1_safe(){ |
| 127 | let ctx = fresh_ctx(); |
| 128 | let total_time = 0; |
| 129 | // Run 1000 trials |
| 130 | for idx in 0..1000{ |
| 131 | let addr = idx * 8; |
| 132 | let now = Instant::now(); |
| 133 | write_method_1_u32(ctx, 1337, addr); |
| 134 | let time = now.elapsed().as_nanos(); |
| 135 | total_time += time; |
| 136 | } |
| 137 | println!("Average safe 32-bit write delay: {:?}", total_time / 1000); |
| 138 | } |
| 139 | |
| 140 | fn trial_1_unsafe(){ |
| 141 | let ctx = fresh_ctx(); |
nothing calls this directly
no test coverage detected