0025801: Some of the commands in BOPTest packages show the execution time without...
[occt.git] / src / BOPTest / BOPTest_CheckCommands.cxx
index 7da70dc..72c7e42 100644 (file)
 #include <BOPAlgo_CheckerSI.hxx>
 #include <BOPAlgo_ArgumentAnalyzer.hxx>
 #include <BOPAlgo_CheckResult.hxx>
-
 #include <BOPTools_AlgoTools.hxx>
 
-#include <BOPTest_Chronometer.hxx>
+#include <OSD_Timer.hxx>
 #include <BOPTest_Objects.hxx>
 
 //
@@ -204,7 +203,7 @@ Standard_Integer bopcheck (Draw_Interpretor& di,
     if (!strcmp(a[i], "-t")) {
       bShowTime=Standard_True;
     }
-  }
+      }
   //
   //aLevel = (n==3) ? Draw::Atoi(a[2]) : aNbInterfTypes-1;
   //-------------------------------------------------------------------
@@ -218,7 +217,6 @@ Standard_Integer bopcheck (Draw_Interpretor& di,
   BOPAlgo_CheckerSI aChecker;
   BOPCol_ListOfShape aLS;
   BOPDS_MapIteratorMapOfPassKey aItMPK;
-  BOPTest_Chronometer aChrono;
   //
   if (aLevel < (aNbInterfTypes-1)) {
     di << "Info:\nThe level of check is set to " 
@@ -239,11 +237,12 @@ Standard_Integer bopcheck (Draw_Interpretor& di,
   aChecker.SetRunParallel(bRunParallel);
   aChecker.SetFuzzyValue(aTol);
   //
-  aChrono.Start();
+  OSD_Timer aTimer;
+  aTimer.Start();
   //
   aChecker.Perform();
   //
-  aChrono.Stop();
+  aTimer.Stop();
   //
   iErr=aChecker.ErrorStatus();
   //
@@ -316,11 +315,9 @@ Standard_Integer bopcheck (Draw_Interpretor& di,
   if (!iCnt) {
     di << " This shape seems to be OK." << "\n";
   }
-  if (bShowTime) {
-    Standard_Real aTime;
-    //
-    aTime=aChrono.Time();
-    Sprintf(buf, "  Tps: %7.2lf\n", aTime);
+  if (bShowTime)
+  {
+    Sprintf(buf, "  Tps: %7.2lf\n", aTimer.ElapsedTime());
     di << buf;
   }
   return 0;
@@ -924,7 +921,7 @@ Standard_Integer xdistef(Draw_Interpretor& di,
                          Standard_Integer n,
                          const char** a)
 {
-  if(n < 3) { 
+  if(n < 3) {
     di << "use xdistef edge face\n";
     return 1;
   }