Firstly, make sure you have cargo installed on your system.
Then, run the following command:
cargo install --git https://github.com/andrwcnln/tictoc
Simply prepend any command you wish to time with tictoc
. It should work with any command and any arguments.
$ tictoc sleep 5
time elapsed 5.002633615