Saturday, March 28th, 2009 | អ្នក​និពន្ធ:

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:

  • realthe actual time elapsed while the command was running – 62 នាទី
  • userthe amount of userland time the command used – 43 នាទី
  • systhe amount of system time the command used – 6 នាទី

(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 កំណែ (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 tookor maybe? just a geeky way to time something random. 😛

ចែករំលែក
ប្រភេទ: លីនុច
អ្នក​អាច​អនុវត្ត​តាម​ការ​ឆ្លើយតប​ណាមួយ​ទៅ​ធាតុ​នេះ​តាម​រយៈ​ការ ធ្វើ RSS ភ្ជាប់ 2.0 មតិ​ព័ត៌មាន. អ្នក​អាច​ធ្វើ​បាន ទុក​ឱ្យ​ឆ្លើយ​តប​មួយ, ឬ ការ​តាមដាន​ត្រលប់ ពី​តំបន់​បណ្ដាញ​ផ្ទាល់​ខ្លួន​របស់​អ្នក.
ទុក​ឱ្យ​ឆ្លើយ​តប​មួយ » ចូល