me@maths131:~$ gcc -Wall -fopenmp canon.cpp -lstdc++
me@maths131:~$ time ./a.out 1000 400
Time required : 10.29
real 0m5.187s
user 0m10.289s
sys 0m0.016s
Now as you can see one is exactly half of other. And i also computed time using stopwatch, it comes in favor of command "time".
I am confused which is right? And its important.
PS: if "time" is right, then suggest some commands to use that time in cpp code in runtime.
¿How is the `user' time longer than the `real' time?
real: time spend between invocation and termination
user: time that the process was executed.
__Keep in mind that there are other process that your processor needs to take care of. So your program is not always executing.
__By instance, if you try to read, or to output to the screen (that are slow devices) you process will be blocked till the operation fulfills.
sys: ¿administration? (process creation, commutation, etc)