Custom Search

Computing: How to measure time

User Time is the time user waits for program to execute. It depends heavily on how OS (operating system) switches between tasks.

Real Time is easy - it is the actual time (in hours, minutes, seconds) that has elapsed.

CPU Time is the time spent executing a single program. It depends solely on design of processor (datapath, pipelining effectiveness, caches, etc.)

Computers are constructed using a clock that runs at a constant rate and determines when events take place in the hardware.These discrete time intervals called clock cycles.

CPU execution time for a program
=
Number of Clock Cycles for a program (N)
x

Measuring Time Using Clock Cycles

Instead of using execution time in seconds, we often use cycles.

Cycle time (or period)

= time between 'ticks' (of the CPU clock)

= number of seconds per cycle.

In physics we give the period a symbol T. As computing uses T for CPU execution time we use the greek letter t tau , but it is all the same thing! It is the time period in seconds.

Clock "ticks" indicate when to start activities. Within the CPU may actions within programs are performed via 'clocked' circuits (action starts on the rising edge of the clock). See flip-flops.

 

Example Question: A CPU has a clock frequency of 133 MHz. If it takes 266 000 cycles to run a program, what is the CPU time?