From b7ec07b58928e351873ade9ae632389099c954c6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Traizet?= <cedric.traizet@c-s.fr>
Date: Wed, 19 Sep 2018 11:31:21 +0200
Subject: [PATCH] DOC : added doc limitations (none)

---
 .../app/otbSmallRegionsMerging.cxx            | 21 +++++++++++--------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/Modules/Applications/AppSegmentation/app/otbSmallRegionsMerging.cxx b/Modules/Applications/AppSegmentation/app/otbSmallRegionsMerging.cxx
index 1693322743..8a4e307feb 100644
--- a/Modules/Applications/AppSegmentation/app/otbSmallRegionsMerging.cxx
+++ b/Modules/Applications/AppSegmentation/app/otbSmallRegionsMerging.cxx
@@ -18,9 +18,6 @@
  * limitations under the License.
  */
 
-
-#include <time.h>
-
 #include "otbWrapperApplication.h"
 #include "otbWrapperApplicationFactory.h"
 
@@ -28,6 +25,8 @@
 #include "otbLabelImageSmallRegionMergingFilter.h"
 #include "itkChangeLabelImageFilter.h"
 
+#include "otbStopwatch.h"
+
 namespace otb
 {
 namespace Wrapper
@@ -77,7 +76,9 @@ private:
                           " pixel will be merged with adjacent segments, then"
                           " all segments of area equal to 2 pixels will be"
                           " processed, until segments of area minsize.");
-                          
+    
+    SetDocLimitations( "None") ;
+    
     SetDocAuthors("OTB-Team");
     SetDocSeeAlso("Segmentation");
     AddDocTag(Tags::Segmentation);
@@ -121,8 +122,9 @@ private:
 
   void DoExecute() override
   {
-    clock_t tic = clock();
-  
+    // Start Timer for the application
+    auto Timer = Stopwatch::StartNew();
+    
     unsigned int minSize     = GetParameterInt("minsize");
 
     //Acquisition of the input image dimensions
@@ -180,9 +182,10 @@ private:
     }
     SetParameterOutputImage("out", changeLabelFilter->GetOutput());
     RegisterPipeline();
-    clock_t toc = clock();
-    otbAppLogINFO(<<"Elapsed time: "<<(double)(toc - tic) / CLOCKS_PER_SEC<<
-      " seconds");
+
+    Timer.Stop();
+    otbAppLogINFO( "Total elapsed time: "<< float(Timer.GetElapsedMilliseconds())/1000 <<" seconds.");
+
   }
   
 };
-- 
GitLab