// cl_timing_report().
// General includes.
-#include "cl_sysdep.h"
+#include "base/cl_sysdep.h"
// Specification.
-#include "cl_timing.h"
+#include "cln/timing.h"
// Implementation.
+namespace cln {
+
// Round to 3 decimal places.
#define CL_HZ 1000
#define CL_HZ_NSECS (1000000000/CL_HZ)
-void cl_timing_report (cl_ostream stream, const cl_time_consumption& t)
+void cl_timing_report (std::ostream& stream, const cl_time_consumption& t)
{
var uintL real_sec = t.realtime.tv_sec;
var uintL real_msec = (t.realtime.tv_nsec + (CL_HZ_NSECS-1)/2) / CL_HZ_NSECS;
var uintL user_sec = t.usertime.tv_sec;
var uintL user_msec = (t.usertime.tv_nsec + (CL_HZ_NSECS-1)/2) / CL_HZ_NSECS;
if (user_msec >= CL_HZ) { user_msec -= CL_HZ; user_sec += 1; }
-#if defined(CL_IO_STDIO)
- fprintf(stream, "real time: %4u.%03u s, run time: %4u.%03u s",
- real_sec, real_msec, user_sec, user_msec);
-#endif
-#if defined(CL_IO_IOSTREAM)
var char oldfill = stream.fill();
var int oldwidth = stream.width();
stream << "real time: ";
stream.fill(oldfill);
stream << " s";
stream.width(oldwidth);
-#endif
}
+
+} // namespace cln