getr exits with status 1 if it fails to spawn a process, or if its own arguments aren't understood. It exits with status 0 in all other cases, including if the spawned program returns a nonzero exit status.
getr 1000 ./fizzbuzz > /dev/null
fizzbuzz is invoked 1000 times, with no arguments, and with getr's own (and therefore fizzbuzz's) standard output piped to /dev/null. The resulting usage report would still be printed to standard error.
getr 100 rdmd -c ''
rdmd in PATH is asked, 100 times, to evaluate the empty string.
getrusage(2), which(1), time(1), perf(1), valgrind(1).
A POSIX application wrapping getrusage(2) for simple benchmarks.
SYNOPSIS: getr <#runs> <command> [<args> ...]
OUTPUT:
DESCRIPTION: getr is a simple wrapper around the getrusage(2) syscall, which can be relied on for basic resource usage reports under Linux, OpenBSD, and macOS (among others). A child command is repeatedly spawned and waited for, and then a RUSAGE_CHILDREN report is generated. This program was created as the author was used to very simple bash loops to test performance, which was then found didn't work at all under ksh on OpenBSD. getr is just as easy and just as simple.