]> Creatis software - cpPlugins.git/commitdiff
...
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Fri, 15 Apr 2016 19:07:14 +0000 (14:07 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Fri, 15 Apr 2016 19:07:14 +0000 (14:07 -0500)
lib/cpPlugins/ProcessObject.cxx
lib/cpPlugins/ProcessObject.h
lib/cpPlugins_Config.h

index f684a6ba54c287220694534372bd3184b62783bc..aa910648c24ca0def0bfbb00174ad68df66543b3 100644 (file)
@@ -1,7 +1,6 @@
 #include <cpPlugins/ProcessObject.h>
 #include <cpPlugins/ParametersQtDialog.h>
 #include <itkProcessObject.h>
-#include <chrono>
 
 // -------------------------------------------------------------------------
 cpPlugins::Parameters* cpPlugins::ProcessObject::
@@ -241,17 +240,11 @@ Update( )
         << this->GetClassName( ) << ":" << this->GetClassCategory( )
         << "\"... ";
       std::cout.flush( );
-      long start =
-        std::chrono::duration_cast< std::chrono::milliseconds >(
-          std::chrono::system_clock::now( ).time_since_epoch( )
-          ).count( );
+      this->m_LastExecutionSpan = cpPlugins_CHRONO;
       r = this->_GenerateData( );
-      long end =
-        std::chrono::duration_cast< std::chrono::milliseconds >(
-          std::chrono::system_clock::now( ).time_since_epoch( )
-          ).count( );
+      this->m_LastExecutionSpan = cpPlugins_CHRONO - this->m_LastExecutionSpan;
       this->m_LastExecutionTime = this->GetMTime( );
-      std::cout << "done in " << ( ( end - start ) / 1000 ) << "s!" << std::endl;
+      std::cout << "done in " << ( double( this->m_LastExecutionSpan ) / double( 1000 ) ) << "s!" << std::endl;
 
     } // fi
 
index 6801fc2f0b7f886139248b6b2e12700ea7a9304e..b0a6a71162901fd8f29f6408b9baf1cbeb7475ba 100644 (file)
@@ -90,6 +90,7 @@ namespace cpPlugins
     _TOutputs m_Outputs;
 
     itk::ModifiedTimeType m_LastExecutionTime;
+    long m_LastExecutionSpan;
   };
 
 } // ecapseman
index 7a228b10b10ee6de452118e7badb7e00330d685c..0c1d0146a4365139a314bbfe44d32c9dbdb14aba 100644 (file)
  * =========================================================================
  */
 
+#include <chrono>
 #include <cstring>
 #include <fstream>
 #include <iostream>
 #include <string>
 
+// -------------------------------------------------------------------------
 #ifdef cpPlugins_SYS_WINDOWS
 #  define cpPlugins_STRTOK( A, B, N ) strtok_s( A, B, N )
 #else // cpPlugins_SYS_WINDOWS
 #  define cpPlugins_STRTOK( A, B, N ) std::strtok( A, B )
 #endif // cpPlugins_SYS_WINDOWS
 
+// -------------------------------------------------------------------------
+#define cpPlugins_CHRONO                                                \
+  std::chrono::duration_cast< std::chrono::milliseconds >(              \
+    std::chrono::system_clock::now( ).time_since_epoch( )               \
+    ).count( )
+
 namespace cpPlugins
 {
   struct IsSeparator