1 // constructor cl_timing(cl_time_consumption&).
4 #include "base/cl_sysdep.h"
7 #include "cln/timing.h"
14 static void report_accu (const cl_timing& t)
16 var const cl_time_consumption usage_end = cl_current_time_consumption();
17 var const cl_time_consumption& usage_start = t.tmp;
18 var cl_time_consumption usage;
19 usage.realtime = usage_end.realtime - usage_start.realtime;
20 usage.usertime = usage_end.usertime - usage_start.usertime;
22 var cl_time_consumption& accumulator = *(cl_time_consumption*)(t.report_destination);
23 accumulator.realtime = accumulator.realtime + usage.realtime;
24 accumulator.usertime = accumulator.usertime + usage.usertime;
27 cl_timing::cl_timing (cl_time_consumption& accumulator)
29 report_fn = report_accu; report_destination = &accumulator;
30 tmp = cl_current_time_consumption();