Skip to content

Support --time-unit microsecond #684

@titzer

Description

@titzer

Apologies if this may have been discussed before, but it would be very useful to have hyperfine report microsecond resolution for times, as this is generally the time unit reported by the underlying system calls, e.g. wait4 on POSIX.

Elsewhere, IIRC, it was stated that execution times exhibit too much variance for this to be useful. I'm not sure this is true; e.g., frustrated by the second and millisecond resolution of the time command on most UNIXes, I did experiments and wrote a utility called btime that reports microseconds. I found that for very short-running programs with a significant number of repeated runs, I was able to reliably characterize statistical distributions down into the hundreds or even tens of microseconds range. Regardless of that distribution, from a tool perspective, I think it makes sense for hyperfine to report measurements at the resolution of the underlying timers rather than round measurements without recourse.

Thanks for considering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions