
25 May
2011
25 May
'11
12:10 p.m.
On 25/05/2011 02:33, Darren Garvey wrote:
template<typename T, T (*P)()> void worker_make() { for (int i = 0; i< 100000; ++ i) T p = P(); }
This is a fairly bad way to write a benchmark, and is likely to yield somewhat incorrect results. You should bench based on an external condition, such as time, rather than making a fixed number of iterations.