Trait MicroBenchConfig

Source
pub unsafe trait MicroBenchConfig {
    const TIMESTAMP_FUNC: fn() -> u64;
}
Expand description

Choose RDTSC variant to use.

§Safety

TIMESTAMP_FUNC must return a greater value to the previous one. Otherwise, the library may cause div-by-zero exception.

Required Associated Constants§

Source

const TIMESTAMP_FUNC: fn() -> u64

Timestamp function to use.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl MicroBenchConfig for DefaultMicroBenchConfig

Source§

const TIMESTAMP_FUNC: fn() -> u64 = {asm::rdtsc_arch as fn() -> u64}