linux - 为什么 sys+user > real 在 "time command"中?

标签 linux unix time pthreads benchmarking

我有一个程序使用 pthread 库来执行 500x500 矩阵的矩阵乘法。每个线程计算矩阵的 50 行。

当我计时它的执行时:

shadyabhi@shadyabhi-desktop:~$ time ./a.out

real    0m0.383s
user    0m0.810s
sys     0m0.000s
shadyabhi@shadyabhi-desktop:~$

为什么系统+用户大于实时

最佳答案

它更大,因为它将所有核心的时间加在一起。

关于linux - 为什么 sys+user > real 在 "time command"中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2461499/

相关文章:

linux - cURL:如果连接超时/挂起,重新启动连接

c++ - 奇怪的 GetTickCount 问题

javascript - RethinkDb:在给定时间戳之前获取 X 个条目

c++ - 从 .SO ( linux ) 导出 C++ 类

linux - 生成文件: executing a multiline function not working

linux - 为什么不同版本的 RHEL 中 df -m $PWD|awk {'print $4' } 的输出不同

unix - bash 输入和输出文件中的 sed 命令

java - Java中有一个全局变量来表示一天的长度吗?

java - 在 JLabel 上显示加密图像

php - 使用 bash 或 php 获取文件夹层次结构