Its amazing how much you can do by combining the small yet powerful commands Unix has available.
This little-used command, time, finally became useful today as a way to report the length of time that certain automated operations are running. In my example, I’m timing how long it takes to build the Linux kernel:
$ time rebuild-kernel26 ... couple-thousand-lines-of-scrolling-text ... ==> Finished making: kernel26 2.6.28.8-1 x86_64 (Sat Mar 28 17:19:52 SAST 2009) real 62m21.994s user 43m31.846s sys 6m1.096s
Yup, that took a little over an hour to build. The values are:
- “real” the actual time elapsed while the command was running – 62 minutes
- “user” the amount of userland time the command used – 43 minutes
- “sys” the amount of system time the command used – 6 minutes
(I was busy doing other things while this was happening which is why it took 62 minutes for the desktop to do (43+6=) 49 minutes-worth of work)
If you’re using the GNU version (most likely), it also gives you the option of displaying the results in a custom fashion. Mostly, this command could be useful in scripts where you need to report how long a task took – or maybe? just a geeky way to time something random. 😛
Recent Comments