Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 greater than real time?

like image 940
Abhijeet Rastogi Avatar asked Mar 17 '10 10:03

Abhijeet Rastogi


1 Answers

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

like image 178
Tuomas Pelkonen Avatar answered Sep 28 '22 02:09

Tuomas Pelkonen