プロセスの壁時計の時間を決定する方法は?

プロセスの壁時計の時間を決定する方法は?

time命令を持つ一般的なLinuxプログラムを見つけました。たとえば、次のようにfoo使用できます。

time foo

次のサンプル出力を提供します。

real    0m8.738s
user    0m5.796s
sys     0m0.576s

しかし、マニュアルページはtime少し不明瞭なようです(Linuxに初めて触れる人であるにもかかわらず)。

TIME(1)                       Linux User's Manual                      TIME(1)



NAME
       time - time a simple command or give resource usage

SYNOPSIS
       time [options] command [arguments...]

DESCRIPTION
       The  time  command  runs  the  specified program command with the given
       arguments.  When command finishes, time writes a  message  to  standard
       error  giving  timing statistics about this program run.  These statis-
       tics consist of (i) the elapsed real time between invocation and termi-
       nation, (ii) the user CPU time (the sum of the tms_utime and tms_cutime
       values in a struct tms as returned by times(2)), and (iii)  the  system
       CPU  time  (the  sum of the tms_stime and tms_cstime values in a struct
       tms as returned by times(2)).

「実際の」時間は、次のことを意味します。壁時計時間?

ベストアンサー1

「実際の」時間は経過時間であり、一般に壁時計の時間の差ですが、必ずしもそうではありません。

たとえば、時間が 02:00 に変更されたロケールで夏時間が適用される日に 01:59:00 にプロセスを開始し、プロセスに 2 分かかる場合、実際の経過時間は 2 分になります。 、壁時計には1時間差が02分で表示されます。 (時間オフセットが再び変更されると、壁時計の差は負になりますが、実際の経過時間は同じままです。)

おすすめ記事