1 // constructor cl_timing(cl_ostream).
12 static void report_stream (const cl_timing& t)
14 var const cl_time_consumption usage_end = cl_current_time_consumption();
15 var const cl_time_consumption& usage_start = t.tmp;
16 var cl_time_consumption usage;
17 usage.realtime = usage_end.realtime - usage_start.realtime;
18 usage.usertime = usage_end.usertime - usage_start.usertime;
20 var cl_ostream destination =
21 #if defined(CL_IO_STDIO)
22 (FILE*) t.report_destination;
24 #if defined(CL_IO_IOSTREAM)
25 *(ostream*) t.report_destination;
28 fprint(destination,t.comment);
29 cl_timing_report(destination,usage);
30 fprint(destination,"\n");
33 cl_timing::cl_timing (cl_ostream destination)
35 report_fn = report_stream;
36 #if defined(CL_IO_STDIO)
37 report_destination = destination;
39 #if defined(CL_IO_IOSTREAM)
40 report_destination = &destination;
43 tmp = cl_current_time_consumption();
46 cl_timing::cl_timing (const char * msg, cl_ostream destination)
48 report_fn = report_stream;
49 #if defined(CL_IO_STDIO)
50 report_destination = destination;
52 #if defined(CL_IO_IOSTREAM)
53 report_destination = &destination;
56 tmp = cl_current_time_consumption();