UNIX 中的 wall-clock-time、user-cpu-time 和 system-cpu-time 具体是什么? [英] What specifically are wall-clock-time, user-cpu-time, and system-cpu-time in UNIX?

查看:7
本文介绍了UNIX 中的 wall-clock-time、user-cpu-time 和 system-cpu-time 具体是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以根据名称进行猜测,但 UNIX 中的 wall-clock-time、user-cpu-time 和 system-cpu-time 具体是什么?

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 time 和 system-cpu time 和你说的差不多——用户代码花费的时间和内核代码花费的时间.

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 中的 wall-clock-time、user-cpu-time 和 system-cpu-time 具体是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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