]> www.ginac.de Git - cln.git/blobdiff - src/timing/cl_t_report.cc
64-bit mingw port: Extend fprintdecimal and fprinthexadecimal up to 'long long'.
[cln.git] / src / timing / cl_t_report.cc
index e0c23bd3854c3528f70a20a926139b495b24f67c..b5c551b0c6cf11ec7050b3ae97f9219d7cba3a5f 100644 (file)
@@ -1,19 +1,21 @@
 // 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;
@@ -21,11 +23,6 @@ void cl_timing_report (cl_ostream stream, const cl_time_consumption& t)
        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: ";
@@ -39,5 +36,6 @@ void cl_timing_report (cl_ostream stream, const cl_time_consumption& t)
        stream.fill(oldfill);
        stream << " s";
        stream.width(oldwidth);
-#endif
 }
+
+}  // namespace cln