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).