Wednesday, August 15, 2007

create screen timer from linux howto

Creating stopwatch or timer from your screen can be done so many ways. This can be applied when you need to track or watch the exact time duration for certain execution of a particular script commands or application.

How to create a timer using linux CLI commands?

Here are few ways to achieve the timer or stopwatch concept from command line terminal. As follow

1. This command shows real time values from your screen that is being updated every microsecond.

# watch -n 0 date

2. Issuing this command does not provide live screenview of current elapsed time or timer stats. Only then if you press Ctrl+C to stop the process, you'll get to see the elapsed time.

# time cat
# time tee

3. And the below approach makes use of available linux and bash commands like so

# while true; do clear; echo `date`; sleep 1s; done

It still works in Fedora!

HTH

No comments:

Post a Comment

Thanks for the comment and for peeping into my blogspot. Hope you enjoy your reading them.

If you wish to receive posts updates, you can subscribe directly from this link:

http://feeds.feedburner.com/VertitosBlogspot

using any RSS reader or even Google Reader.

Again, appreciate your site visits.

Cheers then

VeRTiTO
Email: vertito@gmail.com