Use a Quick and Dirty Stopwatch via the Mac Terminal
Need a super easy and simple Stopwatch on the Mac, but don’t want to download anything like a third party app or utility? Look no further than the command line.
You can create an instant quick and dirty stopwatch via the Mac OS X (or linux) command line by launching the Terminal app and typing a simple command string.
How to Use a Stopwatch at Command Line of Mac OS
Try it yourself, this stopwatch trick is super easy.
To get started, launch the Terminal application, and then type the following following command string:
Now hit enter and the stopwatch begins.
At any point, you can stop the counting stopwatch by hitting Control-C on the keyboard.
Once the stopwatch has ended running, you will return to the command prompt while returning something back that looks like this:
$ time cat
The top ‘real’ number is the elapsed time, that is, time that passed since executing the command.
How this stopwatch works is that you are using the ‘time’ command to measure the time of how long another command takes to execute, but since the cat command requires something to output and we are not providing anything, cat does nothing, thus creating a simple stopwatch. Great little trick, huh?
This uses the time command and thus works in basically every version of macOS, Mac OS X, Linux, and it should also work in just about any other version of unix that supports the time and cat commands as well.
No need for downloads or utilities, if all you need is a simple stop watch just turn to the command line. It’s perfect for situations where you have to time something in a pinch.
And yes you can also use the ‘time’ command to literally time the completion of commands as well, but that’s a topic for another article.
If you have any other tips or tricks about using the time command, or another nifty hint for creating a stopwatch or timer at the command line of Mac OS or linux, share them with us in the comments below!