[Kst] branches/work/kst/portto4/kst/src

Peter Kümmel syntheticpp at gmx.net
Thu Jan 27 19:58:49 CET 2011


SVN commit 1217520 by kuemmel:

move timing info into log

 M  +5 -4      datasources/ascii/asciisource.cpp  
 M  +4 -1      libkst/measuretime.cpp  


--- branches/work/kst/portto4/kst/src/datasources/ascii/asciisource.cpp #1217519:1217520
@@ -299,7 +299,7 @@
 #define MAXBUFREADLEN KST_PREALLOC
 Kst::Object::UpdateType AsciiSource::internalDataSourceUpdate() 
 {
-  MeasureTime t("internalDataSourceUpdate");
+  MeasureTime t("AsciiSource::internalDataSourceUpdate");
 
   if (!_haveHeader) {
     _haveHeader = initRowIndex();
@@ -474,6 +474,7 @@
 #endif
 
   if (_config._columnType == AsciiSourceConfig::Fixed) {
+    MeasureTime t("AsciiSource::readField: same width for all columns");
     LexicalCast lexc;
     lexc.setDecimalSeparator(_config._useDot);
     const char* col_start = &buffer[0] + _config._columnWidth * (col - 1);
@@ -485,16 +486,16 @@
     return n;
   } else if (_config._columnType == AsciiSourceConfig::Custom) {
     if (_config._columnDelimiter.value().size() == 1) {
-      MeasureTime t("character");
+      MeasureTime t("AsciiSource::readField: 1 custom column delimiter");
       const IsCharacter column_del(_config._columnDelimiter.value()[0].toAscii());
       return readColumns(v, buffer, bufstart, bufread, col, s, n, lineending, column_del);
     } if (_config._columnDelimiter.value().size() > 1) {
-      MeasureTime t("string");
+      MeasureTime t(QString("AsciiSource::readField: %1 custom column delimiters").arg(_config._columnDelimiter.value().size()));
       const IsInString column_del(_config._columnDelimiter.value());
       return readColumns(v, buffer, bufstart, bufread, col, s, n, lineending, column_del);
     }
   } else if (_config._columnType == AsciiSourceConfig::Whitespace) {
-    MeasureTime t("whitespace");
+    MeasureTime t("AsciiSource::readField: whitespace separated columns");
     const IsWhiteSpace column_del;
     return readColumns(v, buffer, bufstart, bufread, col, s, n, lineending, column_del);
   }
--- branches/work/kst/portto4/kst/src/libkst/measuretime.cpp #1217519:1217520
@@ -12,6 +12,8 @@
 
 #include "measuretime.h"
  
+#include "debug.h"
+
 #ifdef Q_OS_WIN
 #include <windows.h>
 #else
@@ -101,7 +103,8 @@
 void MeasureTime::print()
 {
   measure();
-  std::cout << qPrintable(name) << ": " << interval << " seconds\n";
+  //std::cout << qPrintable(name) << ": " << interval << " seconds\n";
+  Kst::Debug::self()->log(QString("Timing: %2 sec, Scope: %1").arg(name).arg(interval));
 }
 
 


More information about the Kst mailing list