Processing time and clock time

Asked

Viewed 55 times

3

What is the difference between processing time and clock time?

  • As most current processors support multiple threads so the clock time is usually longer than the processing time (whereas you are referring to the CPU usage time) since the processor will share the use between the various threads and will not compute the time it is waiting.

1 answer

5


Clock time, often called Wall clock time because that’s what you can evaluate from time spent to perform a task by looking at the wall clock, that’s how long it takes to perform that observably.

In general languages have libraries that have an infrastructure to measure this simply and reliably, something like a StopWatch. In some cases the measurement is done outside the executable, especially when you want to measure the executable load as well.

What you call processing time may be processor time. This measure indicates how much processor resource was spent and not the time itself to run. That’s how much time was spent on processor instructions. And it can be divided into user time (your same application) and system time (which your application has delegated to the operating system to do for you). It’s more a measure of fuel expenditure than how long it took to do a lap, even though we talk in time. is a proportion of use of available resource.

It is common for certain tasks that IO has to spend clock time without spending processor time because it keeps waiting for something to run out of the processor. So make a difference.

The fact that having more than one processor can parallelize the processing, so you spend a lot more processor time in total than the clock time, because each processor is a different machine that gives you a total of time available to process.

Note that creating threads simply used does not guarantee this, you need the parallelization to occur. If you create more threads that processors available in extreme case may occur the opposite, the clock time being longer than the processor time, but there will always be loss, even if it does not reverse the clock time.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.