What is Wall-clock time?
The actual elapsed time from start to finish, including I/O waits and time when other programs ran.
Japanese name: 壁時計時間
The actual elapsed time from start to finish, including I/O waits and time when other programs ran.
Japanese name: 壁時計時間
Wall-clock time is the time a user actually waits. CPU time, by contrast, counts only the time the CPU spent executing the program's instructions, split into user time spent in the program's own code and system time the OS spent on its behalf, for example in system calls. For a single-threaded, purely computational program the two are nearly equal; if the program often waits on disk or network, wall-clock time is much longer. When several threads run in parallel, total CPU time can exceed wall-clock time.
The Linux time command reports wall-clock time as real and the CPU-time breakdown as user and sys. To time a section inside a program, use a monotonic clock such as POSIX CLOCK_MONOTONIC rather than the date-and-time clock, which can jump when the system clock is adjusted. A single measurement varies with other activity on the machine and the state of the caches, so the usual practice is to repeat it and compare medians or similar statistics.
The effect of parallelization or I/O improvements is ultimately judged by how much wall-clock time drops. Looking only at CPU time can mislead, since adding threads usually increases the total even when the program finishes sooner. Comparing wall-clock and CPU time side by side, on the other hand, shows whether a program is dominated by waiting or by computation, which points to what to improve. Response time and throughput are also evaluated in terms of wall-clock time.
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.
As an Amazon Associate I earn from qualifying purchases.
This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.