Question 11
Back to Exercise
What does time(NULL) return on most systems?
- A The time of day as a string
- B The current calendar time as time_t – the seconds since 1 January 1970 UTC Correct
- C Milliseconds since the program started
- D A struct tm
Correct Answer: Option B
Convert with localtime/gmtime to a struct tm and format with strftime. For elapsed CPU time use clock().
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!