Stream: beginners

Topic: High precision timer


view this post on Zulip Arbil (Oct 19 2022 at 18:40):

Is there a platform that exposes the high precision timer?

view this post on Zulip Richard Feldman (Oct 19 2022 at 18:42):

not currently, but we could add it to the CLI platform!

view this post on Zulip Arbil (Oct 19 2022 at 18:43):

That would be useful for benchmarking

view this post on Zulip Brendan Hansknecht (Oct 19 2022 at 18:59):

What type of benchmarking are you trying to do? We have a benchmark platform that is pretty simple that specifically is for testing algoritms and their executions speed. If you are looking at more holistic performance, I would definitely advise looking at an external timing tool like hyperfine.

view this post on Zulip Arbil (Oct 20 2022 at 04:23):

Microbenchmarks and algorithms. Is the benchmark platform cli/benches/time_bench.rs?

view this post on Zulip Brendan Hansknecht (Oct 20 2022 at 04:24):

crates/cli_testing_examples/benchmarks

view this post on Zulip Brendan Hansknecht (Oct 20 2022 at 04:25):

Just a number of simple apps that bench specific algorithms. The platform is a simple zig timer (could probably be improved).

view this post on Zulip Brendan Hansknecht (Oct 20 2022 at 04:26):

Also has the ability to load integers for std for config....so super minimal.

view this post on Zulip Brendan Hansknecht (Oct 20 2022 at 04:26):

Oh, and can write to stdout

view this post on Zulip Brendan Hansknecht (Oct 20 2022 at 04:27):

If that is too minimal for what you want to do, I think adding timers (or just a way to get the current time in some high precision format) to the cli platform would be very reasonable.

view this post on Zulip Brendan Hansknecht (Oct 20 2022 at 04:28):

Let us know if you need help with the platform

view this post on Zulip Arbil (Oct 20 2022 at 04:58):

Thank you, will play with this

view this post on Zulip Anton (Oct 20 2022 at 06:59):

See also crates/cli/benches/README.md.


Last updated: Jul 05 2025 at 12:14 UTC