minstant icon indicating copy to clipboard operation
minstant copied to clipboard

Performant time measuring in Rust

Minstant

Actions Status Build Status LICENSE

A Rust library to measure time with high performance.

Performance

left minstant , right std::time

our std

Usage

[dependencies]
minstant = { git = "https://github.com/tikv/minstant.git", branch = "master" }

similar to std::time::Instance

let start = Instance::now();
// do blablabla
let dur = start.elapsed();

Motivation

The main purpose is to use TSC on x86 processors to measure time at high speed without losing much accuracy. If TSC is inaccessible (on non-x86 systems) or unreliable, it will fallback to coarse time.