use offroad::prelude::*;
use std::time::Instant;
use togo::{poly::arcline200, prelude::*};
fn main() {
println!("Multi-Offset Benchmark (~200 arcs in double spiral)");
println!("======================================================");
let mut cfg = OffsetCfg::default();
cfg.svg_orig = false;
let arc_orig = arcline200();
let start = Instant::now();
for _ in 0..10 {
for i in 1..100 {
offset_arcline_to_arcline(&arc_orig, (i as f64) / 4.0, &mut cfg);
}
let arcs_reversed = arcline_reverse(&arc_orig);
for i in 1..100 {
offset_arcline_to_arcline(&arcs_reversed, (i as f64) / 4.0, &mut cfg);
}
}
let total_time = start.elapsed();
let operations = 10 * 99 * 2; let avg_per_operation = total_time / operations;
println!(
"Total time for {} offset operations: {:?}",
operations, total_time
);
println!("Average time per operation: {:?}", avg_per_operation);
println!(
"Operations per second: {:.1}",
1.0 / avg_per_operation.as_secs_f64()
);
}