Skip to content

Commit 677a5f9

Browse files
committed
feat(divan_compat): add perf walltime support
1 parent 84358c6 commit 677a5f9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • crates/divan_compat/divan_fork/src/bench

crates/divan_compat/divan_fork/src/bench/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,8 @@ impl<'a> BenchContext<'a> {
657657

658658
let bench_overheads = timer.bench_overheads();
659659

660+
use codspeed::fifo::*;
661+
let _guard = PerfGuard::new(RUNNER_CTL_FIFO, RUNNER_ACK_FIFO);
660662
while {
661663
// Conditions for when sampling is over:
662664
if elapsed_picos >= max_picos {
@@ -810,6 +812,7 @@ impl<'a> BenchContext<'a> {
810812
elapsed_picos = elapsed_picos.saturating_add(progress_picos);
811813
}
812814
}
815+
core::mem::drop(_guard);
813816

814817
// Reset flag for ignoring allocations.
815818
crate::alloc::IGNORE_ALLOC.set(false);

0 commit comments

Comments
 (0)