Time consideration for any program.

Time of execution on Linux:

real 0m0.004s

user 0m0.000s

sys 0m0.004s

Which of these I should consider?

1 Like

After reading some articles on internet i found this one: http://www.ewhathow.com/2013/10/how-to-measure-program-execution-time-in-linux/

And according to this article:

real: The total elapsed time between start and end of the program.

user: The user CPU time that the program used. This includes all user mode library calls that the program made.

sys: The system CPU time that the program used. This includes only the kernel system calls and not any user library calls.

So in your output, the real time is 4 milliseconds, the user time is 0 milliseconds and the system time is 4 milliseconds. In most cases, what you are looking for is the real time, which is the total execution time in seconds for the application to run.

Hope you understood…! :slight_smile: