UNIX 中的挂钟时间、用户 CPU 时间和系统 CPU 时间具体是什么? [英] What specifically are wall-clock-time, user-cpu-time, and system-cpu-time in UNIX?

查看:29
本文介绍了UNIX 中的挂钟时间、用户 CPU 时间和系统 CPU 时间具体是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以根据名称进行猜测,但 UNIX 中的挂钟时间、用户 CPU 时间和系统 CPU 时间具体是什么?

I can take a guess based on the names, but what specifically are wall-clock-time, user-cpu-time, and system-cpu-time in UNIX?

user-cpu time 是否是执行用户代码所花费的时间,而 kernel-cpu time 是否是由于需要特权操作(例如 IO 到磁盘)而在内核中花费的时间?

Is user-cpu time the amount of time spent executing user-code while kernel-cpu time the amount of time spent in the kernel due to the need of privileged operations (like IO to disk)?

这个测量的时间单位是什么?

What unit of time is this measurement in?

挂钟时间真的是进程在 CPU 上花费的秒数还是名称只是误导?

And is wall-clock time really the number of seconds the process has spent on the CPU or is the name just misleading?

推荐答案

挂钟时间是墙上的时钟(或手中的秒表)测量的时间,即从进程开始到现在'.

Wall-clock time is the time that a clock on the wall (or a stopwatch in hand) would measure as having elapsed between the start of the process and 'now'.

user-cpu 时间和 system-cpu 时间和你说的差不多——花在用户代码上的时间和花在内核代码上的时间.

The user-cpu time and system-cpu time are pretty much as you said - the amount of time spent in user code and the amount of time spent in kernel code.

单位是秒(和亚秒,可能是微秒或纳秒).

The units are seconds (and subseconds, which might be microseconds or nanoseconds).

挂钟时间不是进程在 CPU 上花费的秒数;它是经过的时间,包括等待它打开 CPU(而其他进程开始运行)所花费的时间.

The wall-clock time is not the number of seconds that the process has spent on the CPU; it is the elapsed time, including time spent waiting for its turn on the CPU (while other processes get to run).

这篇关于UNIX 中的挂钟时间、用户 CPU 时间和系统 CPU 时间具体是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆