Computer Science

CPU Execution Time

Estimate CPU execution time.

CPU Time = Instruction Count × CPI × Clock Cycle Time

Formula Explanation

Execution time depends on the number of instructions, average cycles per instruction and duration of a clock cycle.

Variables Explained

Instruction Count = Executed instructions; CPI = Average cycles per instruction.

Solved Example

A program executes 1,000 instructions with CPI 2 and cycle time 1 ns.
CPU time = 1000 × 2 × 1 ns = 2000 ns = 2 μs.

Exam Tip

Use average CPI when instructions have different cycle costs.