From 0d6ade930afc46fccb75f904d8b5e7b1a3dbbeda Mon Sep 17 00:00:00 2001 From: ded-furby <190979964+ded-furby@users.noreply.github.com> Date: Tue, 2 Jun 2026 01:25:13 +1000 Subject: [PATCH] docs: mention HYPERFINE_ITERATION in README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index ff6020064..630e97681 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,12 @@ option: hyperfine -L compiler gcc,clang '{compiler} -O2 main.cpp' ``` +If you need a unique value for each individual run of a benchmark command, hyperfine also exposes +the zero-based `$HYPERFINE_ITERATION` environment variable inside the benchmarked command itself: +```sh +hyperfine 'my-command > output-${HYPERFINE_ITERATION}.log' +``` + ### Intermediate shell By default, commands are executed using a predefined shell (`/bin/sh` on Unix, `cmd.exe` on Windows).