#[must_use]
#[cfg(all(feature = "diagnostics", target_arch = "wasm32"))]
pub(in crate::db) fn read_local_instruction_counter() -> u64 {
crate::runtime::performance_counter(1)
}
#[must_use]
#[cfg(not(all(feature = "diagnostics", target_arch = "wasm32")))]
pub(in crate::db) const fn read_local_instruction_counter() -> u64 {
0
}
pub(in crate::db) fn measure_local_instruction_delta<T>(run: impl FnOnce() -> T) -> (u64, T) {
let start = read_local_instruction_counter();
let result = run();
let delta = read_local_instruction_counter().saturating_sub(start);
(delta, result)
}