Performance Analysis
What is the difference between wall-clock time and CPU time?
- AWall-clock time is the actual elapsed time from start to finish, including I/O waits; CPU time counts only time the CPU spent executing the program
- BWall-clock time and CPU time are always equal
- CCPU time is time measured on a wall clock
Show answer and explanation
Answer: A. Wall-clock time is the actual elapsed time from start to finish, including I/O waits; CPU time counts only time the CPU spent executing the program
Wall-clock time is what the user actually waits, including time spent waiting for disk or network and time yielded to other programs. CPU time is the total time the CPU spent executing the program's instructions. If wall-clock time is much longer than CPU time, a lot of time is spent waiting. Conversely, with multiple threads running in parallel, total CPU time can exceed wall-clock time.
- A. Correct. Their difference reveals waiting time.
- B. They differ when there is waiting or parallel execution.
- C. A wall clock measures wall-clock time.