Boost timer library : formatting a cpu_times value always prints zeros ?

12 Feb
2012
12 Feb
'12
9 a.m.
Hello, I'm trying to use the boost::timer library, but I can't get to 'format' function to work : it always prints zero values. I followed the documentation : http://www.boost.org/doc/libs/1_48_0/libs/timer/doc/cpu_timers.html#Default-... Here is my code : { boost::timer::cpu_timer cput; someFunctionTakingTime(); std::cout<<cput.elapsed().user/1000000000.0<<std::endl; std::cout<<cput.format(3,"%ws\n")<<std::endl; } Here is the result I get : 0.390002 0.000s Using auto_cpu_timer does not help. Is there something wring in my code ?
4876
Age (days ago)
4876
Last active (days ago)
0 comments
1 participants
participants (1)
-
Jean-Francois Romang