From: Leonardo Florez-Valencia Date: Fri, 15 Apr 2016 19:07:14 +0000 (-0500) Subject: ... X-Git-Tag: v0.1~188 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=22cb3969b7d62fffa30a106eaf9a5f7c7a2dabf4;p=cpPlugins.git ... --- diff --git a/lib/cpPlugins/ProcessObject.cxx b/lib/cpPlugins/ProcessObject.cxx index f684a6b..aa91064 100644 --- a/lib/cpPlugins/ProcessObject.cxx +++ b/lib/cpPlugins/ProcessObject.cxx @@ -1,7 +1,6 @@ #include #include #include -#include // ------------------------------------------------------------------------- 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 diff --git a/lib/cpPlugins/ProcessObject.h b/lib/cpPlugins/ProcessObject.h index 6801fc2..b0a6a71 100644 --- a/lib/cpPlugins/ProcessObject.h +++ b/lib/cpPlugins/ProcessObject.h @@ -90,6 +90,7 @@ namespace cpPlugins _TOutputs m_Outputs; itk::ModifiedTimeType m_LastExecutionTime; + long m_LastExecutionSpan; }; } // ecapseman diff --git a/lib/cpPlugins_Config.h b/lib/cpPlugins_Config.h index 7a228b1..0c1d014 100644 --- a/lib/cpPlugins_Config.h +++ b/lib/cpPlugins_Config.h @@ -52,17 +52,25 @@ * ========================================================================= */ +#include #include #include #include #include +// ------------------------------------------------------------------------- #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