tags:

views:

108

answers:

3

Following up on a question I posed earlier:

I ended up with a User CPU time and Total CPU time that was about 4% longer in duration than the elapsed real time. Based on the accepted answer to my earlier question, I don't understand how this could be the case. Could anyone explain this?

+2  A: 

Multithreaded code on multiple cores can use more than 100% CPU time.

Ignacio Vazquez-Abrams
+2  A: 

Because if I use two CPUs at 100% for 10 minutes, I've used 20 minutes worth of CPU time (i.e. were one of those CPUs disabled, it would take 20 minutes for my operation to complete)

Paul Betts
+2  A: 

One possibility to benchmarks being off by a small margin is due to incorrect timer resolution.

There are quite a few ways of determining those values (time, ticks, CPU frequency, OS API, etc) so not all benchmark routines are 100% reliable.

jcinacio