28 Aug
2011
28 Aug
'11
9:02 p.m.
Vicente J. Botet Escriba wrote:
Le 26/08/11 13:01, Julian Gonggrijp a écrit :
Could you please advice me on the best way to find both the user and system components of the process cpu time taken by a piece of code?
I see a way a little bit verbose but not too much complicated:
clock::duration delta = end-start; process_cpu_clock_times times=delta.count(); return (process_user_cpu_clock::duration(times.user) + process_system_cpu_clock::duration(times.system));
Thanks! It's a bit verbose indeed but I'm already glad there is a way that doesn't involve two clocks. -Julian