Add bench_duration function