Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I've been trying to find a decent way to monitor elapsed time in the shell. Basically, I'm asking for a stopwatch. The end result is easy enough to accomplish; I've seen examples of using time read, and then hitting enter when you're done, but that method makes the current terminal unusable.

Ideally, I'd like something like:

timer start
(do some work, vim, python, etc.)
timer stop

It also would be nice if there was a way to pause the timer. For reference, I was planning on using it to time how long it takes to finish programming assignments from MIT's OCW. As such, since the assignments might be completed in more than one sitting, a way to pause and continue the timer would be beneficial.

Is there anything like this?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You may try a shell script (call it like this:

. timer.val

case "$1" in 
   echo "TIMERSTART=`date +%s`" > timer.val
   TIMEREND=`date +%s`
   echo $TIMEREND
   echo $RESULT
   echo "no command"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.