The timeit
utility measures the time of command execution.
It has some features inspired by the FreeBSD /usr/bin/time
:
- Human friendly output (for example:
1h32m43s
instead of5563.00
)
Time a command, with or without options:
$ timeit sleep 61
timeit results:
real: 1m1.008s
Time a shell construct: you have to time the execution of a subshell, for example:
$ timeit fish -c 'for i in (seq 3); sleep 1; echo $i; end'
1
2
3
timeit results:
real: 3.035s
Time a command and print intermediate timings:
$ timeit -ticker 30s sleep 60
timeit ticker: running since 30.001s
timeit ticker: running since 1m0.004s
timeit results:
real: 1m0.005s
Check online if there is a more recent version:
$ timeit -check-version
installed version v0.2.1 is older than the latest version v0.3.0
To upgrade visit https://github.com/marco-m/timeit
Pre 1.0.0. Working and tested, backwards incompatible changes possible.
Unix-like and macOS.
- Download the archive for your platform from the releases page.
- Unarchive and copy the
timeit
executable somewhere in your$PATH
. I like to use$HOME/bin/
.
You have to cope with the macOS gatekeeper, that will put the executable in quarantine, since it is not signed nor notarized. There are two options:
- Download the archive with a command-line tool, like curl or wget.
- Download the archive with a web browser, unarchive and run
$ xattr -d com.apple.quarantine timeit
- Install task.
$ task
Then, copy the executable to a directory in your $PATH
.
$ env RELEASE_TAG=v0.1.0 summon task release
This code is released under the MIT license, see file LICENSE.