1 // constructor cl_timing(std::ostream&).
4 #include "base/cl_sysdep.h"
7 #include "cln/timing.h"
14 static void report_stream (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 std::ostream& destination = *(std::ostream*) t.report_destination;
24 fprint(destination,t.comment);
25 cl_timing_report(destination,usage);
26 fprint(destination,"\n");
29 cl_timing::cl_timing (std::ostream& destination)
31 report_fn = report_stream;
32 report_destination = &destination;
34 tmp = cl_current_time_consumption();
37 cl_timing::cl_timing (const char * msg, std::ostream& destination)
39 report_fn = report_stream;
40 report_destination = &destination;
42 tmp = cl_current_time_consumption();