Did you ever run a process in a terminal that took longer than you expected to finish, and like such, you wanted to know how long it took? Since you didn’t know it would be a long one, you thought running it with
time was unnecessary, or maybe you just forgot it… Now what?
Wouldn’t it be awesome if you could find out how long that process took to run? How about if it were as simple as typing
timelast or another command that makes sense to you? Well, awesomeness now exists.
I’ve poked around and have put together a script that, once sourced from your
.bashrc, will give you this exact functionality I just talked about. Take a look at a quick example:
[eduardo@dudubuntu:~]$ sleep 3s
[eduardo@dudubuntu:~]$ sleep 90s
[eduardo@dudubuntu:~]$ sleep 3666s
Cool, uh? The source code is available here (sorry about the pastebin, I can’t upload it to the blog). I’d say it is fairly well commented, but feel free to contact me if you’re wondering what is going on under the hood.