Stopwatch in command-line

How can I create a simple stopwatch in command-line? With the command “read”, it is not difficult to this,

Way 1, run command “time read” ( Control + d to stop)

Way 2, time read -sn1 (Press any key to stop)


$ time read -sn1

real 0m0.042s
user 0m0.000s
sys 0m0.000s

Leave a comment

Your email address will not be published. Required fields are marked *