Base: Implement TimeElapsed

Some instances of TimeInfo serve the sole purpose of measuring time
duration. Using system time is unfortunate as it returns wall clock,
which is not guaranteed to be monotonic. Replace such a usage with
the new TimeElapsed class based on steady clock.
This commit is contained in:
Ladislav Michl
2024-01-21 19:00:57 +01:00
parent 159fe5c21f
commit e4d304f934
10 changed files with 93 additions and 52 deletions

View File

@@ -186,7 +186,7 @@ void ViewProviderFemMeshPy::setNodeColor(Py::Dict arg)
this->getViewProviderFemMeshPtr()->resetColorByNodeId();
}
else {
Base::TimeInfo Start;
Base::TimeElapsed Start;
Base::Console().Log(
"Start: ViewProviderFemMeshPy::setNodeColor() =================================\n");
// std::map<long,App::Color> NodeColorMap;
@@ -209,12 +209,12 @@ void ViewProviderFemMeshPy::setNodeColor(Py::Dict arg)
App::Color(Py::Float(color[0]), Py::Float(color[1]), Py::Float(color[2]), 0);
}
Base::Console().Log(" %f: Start ViewProviderFemMeshPy::setNodeColor() call \n",
Base::TimeInfo::diffTimeF(Start, Base::TimeInfo()));
Base::TimeElapsed::diffTimeF(Start, Base::TimeElapsed()));
// this->getViewProviderFemMeshPtr()->setColorByNodeId(NodeColorMap);
this->getViewProviderFemMeshPtr()->setColorByNodeId(NodeIds, NodeColors);
Base::Console().Log(" %f: Finish ViewProviderFemMeshPy::setNodeColor() call \n",
Base::TimeInfo::diffTimeF(Start, Base::TimeInfo()));
Base::TimeElapsed::diffTimeF(Start, Base::TimeElapsed()));
}
}