开发者

Why is sys+user > real in "time command"?

开发者 https://www.devze.com 2022-12-23 18:30 出处:网络
I have a program that uses pthread library to do the matrix multiplication of 500x500 matrix. Each thread calculates 50 rows of the matrix.

I have a program that uses pthread library to do the matrix multiplication of 500x500 matrix. Each thread calculates 50 rows of the matrix.

When I time its execution:

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

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

Why is sys+user is 开发者_C百科greater than real time?


It is greater, because it adds the time from all the cores together.

0

精彩评论

暂无评论...
验证码 换一张
取 消