
timeはUNIXやLinuxなどのOS上で、指定されたコマンドの実行時間を得るために用いられるプログラムである。 time is a UNIX or Linux and OS, the programs used to obtain the execution time of the specified command.
目次 Contents |
最も簡単な利用方法は、実行時間を計測したいコマンドの前に、timeを付けるだけである。 The simplest method used before the command you want to measure the execution time, time is simply put.
time ls time ls
指定されたコマンド(ここではlsコマンド)の実行完了後に、timeは実行に要した時間、具体的にはUser CPU時間、System CPU時間、Real CPU時間を返す。 Specified command (here ls command) after running, time is time spent performing the particular User CPU time, System CPU time, Real CPU time to return.
$ time host wikipedia.org $ Time host wikipedia.org wikipedia.org has address 207.142.131.235 wikipedia.org has address 207.142.131.235 0.000u 0.000s 0:00.17 0.0% 0+0k 0+0io 0pf+0w 0.000u 0.000s 0:00.17 0.0% 0 +0 k 0 +0 io 0pf +0 w $ $
Real CPU時間とは、プログラムがその内部処理に要した時間と、プログラムがカーネルに対してシステムコールを行うのに要した時間の合計である。 Real CPU time and the time taken to process and its internal program, the total time taken to make the call to the kernel program system. たとえばプログラム中でループ処理をしているときに費やしている時間はUser CPU時間であり、execやfork等のシステムコールを行うのに要した時間はSystem CPU時間である。 When the time is spent in a program loop is User CPU time, for example, exec or fork system call time taken to perform the other is the System CPU time. Real CPU時間は双方を合計したものである。 Real CPU time is the sum of what both sides.
| ||||||||||||||||||||||||||
