[MOAB-dev] r3862 - MOAB/trunk/src

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Fri May 7 15:41:29 CDT 2010


Author: kraftche
Date: 2010-05-07 15:41:29 -0500 (Fri, 07 May 2010)
New Revision: 3862

Modified:
   MOAB/trunk/src/DebugOutput.cpp
   MOAB/trunk/src/DebugOutput.hpp
Log:
add functions to prefix debug output with CPU time

Modified: MOAB/trunk/src/DebugOutput.cpp
===================================================================
--- MOAB/trunk/src/DebugOutput.cpp	2010-05-07 17:31:09 UTC (rev 3861)
+++ MOAB/trunk/src/DebugOutput.cpp	2010-05-07 20:41:29 UTC (rev 3862)
@@ -111,12 +111,24 @@
   lineBuffer.insert( lineBuffer.end(), buffer, buffer + strlen(buffer) );
   process_line_buffer();
 }
+
+void DebugOutput::tprint_real( const char* buffer )
+{
+  tprint();
+  print_real( buffer );
+}
   
 void DebugOutput::print_real( const std::string& str )
 {
   lineBuffer.insert( lineBuffer.end(), str.begin(), str.end() );
   process_line_buffer();
 }
+  
+void DebugOutput::tprint_real( const std::string& str )
+{
+  tprint();
+  print_real( str );
+}
 
 void DebugOutput::print_real( const char* fmt, va_list args1, va_list args2 )
 {
@@ -155,6 +167,12 @@
   process_line_buffer();
 }
 
+void DebugOutput::tprint_real( const char* fmt, va_list args1, va_list args2 )
+{
+  tprint();
+  print_real( fmt, args1, args2 );
+}
+
 static void print_range( char* buffer, unsigned long begin, unsigned long end )
 {
   assert(end > begin);
@@ -269,4 +287,14 @@
   }
 }
 
+void DebugOutput::tprint()
+{
+  clock_t t = clock();
+  double tm = ((double)t)/CLOCKS_PER_SEC;
+  size_t s = lineBuffer.size();


More information about the moab-dev mailing list