|0.1.1||Jan 12, 2023|
|0.1.0||Jan 12, 2023|
#644 in Command line utilities
ctime or Crab Timer, for rustaceans, is a command line utility to get run-time from a Windows, MacOS, or Linux system program. All of these different systems have a different default
time utility. The goal of this was to use one program for all three when benchmarking a program's run-time.
The package is currently avaliable through
cargo Rust's package manager.
You can install it with:
cargo install ctime
The crates.io page is here
Prepend this program to another command-line program to time the total run-time of the timed program. Use
-s to not display stdout of the program being timed.
ctime echo 'HELLO'
This would output:
$ ctime echo 'HELLO' HELLO Time elapsed: 427.253µs
Using with an actual benchmark program, like the Python
mandlebrot set would look like this:
$ ctime python3 mandlebrot.py 16000 -s Time elapsed: 23.450438757s
Running on a Windows Machine via Powershell:
PS $> ctime python3 .\mandlebrot.py 16000 -s Time elapsed: 24.412431292s
Comparing to the "real" value from
$ time python3 mandlebrot.py 16000 > /dev/null real 0m23.590s user 9m21.693s sys 0m0.924s