Patterned after a shorter comparison in Learning Tree Course 396, Unix Tools & Utilities.
This depends on the output format of the original BSD version of the time command. I have added the source here, but it will take a bit of porting to run on foreign systems. Meanwhile, you might be able to make it work on Linux with something like
alias time='time -f " %E real %U user %S system"'
But this has not been tested!
A minimally-invasive pull request that gets it going either way would be appreciated.
To use the Java version, you need to install a Java SDK ("JDK"). The current release is Java 23, but the code is simple enough that any release of JDK 11 or later should suffice.
Using your system’s package manager, install as many Awk implementations as you can find - gawk hawk mawk nawk are the most likely ones.
There are two sets of tests in the variable PROGS in the runall script. The first one is the full one; the second is a shorter one (omitting the slowest tests) for testing, mainly used when modifying the base package (i.e., for normal use you want the full one). Edit runall to un-comment the one you want.