From: Zhuravlev Kirill Date: Tue, 30 Mar 2021 13:21:27 +0000 (+0300) Subject: Added timers X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=89fc0da6f8948865fd73fbea98b33d7f52c1d9df;p=occt-copy.git Added timers Signed-off-by: Zhuravlev Kirill --- diff --git a/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx b/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx index fac47dd9e1..f95f3dd877 100644 --- a/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx +++ b/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx @@ -41,6 +41,9 @@ #include #include #include + +#include + #include #include #include @@ -60,6 +63,9 @@ #include #include #include +//----------------------------------------------------------- +#include +//----------------------------------------------------------- // static @@ -108,6 +114,13 @@ BOPAlgo_BuilderSolid::~BOPAlgo_BuilderSolid() //======================================================================= void BOPAlgo_BuilderSolid::Perform(const Message_ProgressRange& theRange) { + //Timer construction + //--------------------------------------------------------------------- + OSD_Timer DurationTimer; + //--------------------------------------------------------------------- + + DurationTimer.Start(); + GetReport()->Clear(); // if (myShapes.IsEmpty()) @@ -119,23 +132,40 @@ void BOPAlgo_BuilderSolid::Perform(const Message_ProgressRange& theRange) myBoxes.Clear(); + DurationTimer.Stop(); + std::cout << "Prelim. duration: " << DurationTimer.ElapsedTime() << std::endl; + TopoDS_Compound aC; BRep_Builder aBB; TopTools_ListIteratorOfListOfShape aIt; // + DurationTimer.Restart(); aBB.MakeCompound(aC); + DurationTimer.Stop(); + std::cout << "MakeCompound duration: " << DurationTimer.ElapsedTime() << std::endl; + + DurationTimer.Restart(); aIt.Initialize(myShapes); + DurationTimer.Stop(); + std::cout << "Initialize duration: " << DurationTimer.ElapsedTime() << std::endl; + + DurationTimer.Restart(); for(; aIt.More(); aIt.Next()) { const TopoDS_Shape& aF=aIt.Value(); aBB.Add(aC, aF); } + DurationTimer.Stop(); + std::cout << "ItLoop duration: " << DurationTimer.ElapsedTime() << std::endl; // if (!theRange.More()) { return; } // + DurationTimer.Restart(); PerformShapesToAvoid(); + DurationTimer.Stop(); + std::cout << "PerformShapesToAvoid duration: " << DurationTimer.ElapsedTime() << std::endl; if (HasErrors()) { return; } @@ -145,7 +175,10 @@ void BOPAlgo_BuilderSolid::Perform(const Message_ProgressRange& theRange) return; } // + DurationTimer.Restart(); PerformLoops(); + DurationTimer.Stop(); + std::cout << "PerformLoops duration: " << DurationTimer.ElapsedTime() << std::endl; if (HasErrors()) { return; } @@ -155,7 +188,10 @@ void BOPAlgo_BuilderSolid::Perform(const Message_ProgressRange& theRange) return; } // + DurationTimer.Restart(); PerformAreas(); + DurationTimer.Stop(); + std::cout << "PerformAreas duration: " << DurationTimer.ElapsedTime() << std::endl; if (HasErrors()) { return; } @@ -165,7 +201,10 @@ void BOPAlgo_BuilderSolid::Perform(const Message_ProgressRange& theRange) return; } // + DurationTimer.Restart(); PerformInternalShapes(); + DurationTimer.Stop(); + std::cout << "PerformInternalShapes duration: " << DurationTimer.ElapsedTime() << std::endl; if (HasErrors()) { return; }