cpu

Anyone care to tell me what the difference is between the term `Time` and `CPU`?

Guys, I'm quite new to *Google Benchmark*,

Anyone care to tell me what the difference is between the term `Time` and `CPU`?
 


Benchmark                                         Time             CPU           Iterations
>-----------------------------------------------------------------------------------------
>BM_Original                                    105 ns           105 ns        6975724
>BM_Alternative                               97.5 ns          97.4 ns       7628098
>BM_Alternative/threads:100         1.80 ns          176 ns        3962100


Where can I see the definition of them? It seems a bit difficult for me to find some _manual_ in that regard.
(I mean why is `CPU` higher than `Time`? :confused:)

 
You already invited:

Amos

Upvotes from:

Time is time spent running the benchmark. CPU is the same but integrated over the number of CPU threads tha have been running code. So if you have a perfectly parallelized algorithm, that runs in half the time on double the number of CPUs, you should see the same number in the CPU column, while the Time column will say you're twice as fast.

If you wanna answer this question please Login or Register