0

I have been told time command can calculate real time, user time, and system time. But according to the internet time returns time passed since January 1st 1970. Maybe i need to pass some special parameter to calculate details of execution time?

Edit

I suppose this is the answer for my question: Execution time of C program

I consider the question closed.

Catter897
  • 53
  • 3
  • 1
    Probably they were talking about `times` not `time` – Mat Oct 29 '20 at 10:43
  • Does this answer your question? [Get the current time in C](https://stackoverflow.com/questions/5141960/get-the-current-time-in-c) – badcode Oct 29 '20 at 10:44
  • No, [the `time()` function in the C11 Standard Library](http://port70.net/~nsz/c/c11/n1570.html#7.27.2.4) "determines the current calendar time (in an unspecified encoding)"; no mention of user time or system time or processor time. – pmg Oct 29 '20 at 10:44

1 Answers1

0

use the function: clock_gettime() see man clock_gettime for the details of how to use this function.

user3629249
  • 16,402
  • 1
  • 16
  • 17