Search code examples
rustbenchmarking

Is it possible to change Rust benchmark results to a different time unit?


I just ran some Rust benchmarks and I see that the results are always displayed in ns. Is is possible to change the time units of the benchmark to something else? For example, to ms?


Solution

  • No, it is not possible.

    Unless you want to write a wrapper script that runs a regex and replaces the numbers after dividing them, but I doubt that’s what you meant.

    There are 10^9 nanoseconds in a second.