[prev] [index] [next]

Performance Analysis (cont)

Coarse-grained performance analysis
  • devise a range of representative inputs
  • measure execution time of program on each input
  • can conveniently be combined with testing
    (but we only care about timing if correct result produced)
The Unix time command provides a suitable mechanism

$ time ./myProg < LargeInput > /dev/null
real  0m5.064s
user  0m4.113s
sys   0m0.802s