Merge pull request #12066 from 3x380V/time_cleanup

Base: Use std::chrono for time manipulation
This commit is contained in:
Chris Hennes
2024-03-05 15:47:33 -06:00
committed by GitHub
19 changed files with 173 additions and 377 deletions

View File

@@ -197,7 +197,7 @@ int Sketch::setUpSketch(const std::vector<Part::Geometry*>& GeoList,
const std::vector<Constraint*>& ConstraintList,
int extGeoCount)
{
Base::TimeInfo start_time;
Base::TimeElapsed start_time;
clear();
@@ -339,10 +339,10 @@ int Sketch::setUpSketch(const std::vector<Part::Geometry*>& GeoList,
calculateDependentParametersElements();
if (debugMode == GCS::Minimal || debugMode == GCS::IterationLevel) {
Base::TimeInfo end_time;
Base::TimeElapsed end_time;
Base::Console().Log("Sketcher::setUpSketch()-T:%s\n",
Base::TimeInfo::diffTime(start_time, end_time).c_str());
Base::TimeElapsed::diffTime(start_time, end_time).c_str());
}
return GCSsys.dofsNumber();
@@ -4538,21 +4538,21 @@ bool Sketch::updateNonDrivingConstraints()
int Sketch::solve()
{
Base::TimeInfo start_time;
Base::TimeElapsed start_time;
std::string solvername;
auto result = internalSolve(solvername);
Base::TimeInfo end_time;
Base::TimeElapsed end_time;
if (debugMode == GCS::Minimal || debugMode == GCS::IterationLevel) {
Base::Console().Log("Sketcher::Solve()-%s-T:%s\n",
solvername.c_str(),
Base::TimeInfo::diffTime(start_time, end_time).c_str());
Base::TimeElapsed::diffTime(start_time, end_time).c_str());
}
SolveTime = Base::TimeInfo::diffTimeF(start_time, end_time);
SolveTime = Base::TimeElapsed::diffTimeF(start_time, end_time);
return result;
}

View File

@@ -5043,7 +5043,7 @@ int System::diagnose(Algorithm alg)
if (qrAlgorithm == EigenDenseQR) {
#ifdef PROFILE_DIAGNOSE
Base::TimeInfo DenseQR_start_time;
Base::TimeElapsed DenseQR_start_time;
#endif
if (J.rows() > 0) {
int rank = 0; // rank is not cheap to retrieve from qrJT in DenseQR
@@ -5101,9 +5101,9 @@ int System::diagnose(Algorithm alg)
}
}
#ifdef PROFILE_DIAGNOSE
Base::TimeInfo DenseQR_end_time;
Base::TimeElapsed DenseQR_end_time;
auto SolveTime = Base::TimeInfo::diffTimeF(DenseQR_start_time, DenseQR_end_time);
auto SolveTime = Base::TimeElapsed::diffTimeF(DenseQR_start_time, DenseQR_end_time);
Base::Console().Log("\nDenseQR - Lapsed Time: %f seconds\n", SolveTime);
#endif
@@ -5112,7 +5112,7 @@ int System::diagnose(Algorithm alg)
#ifdef EIGEN_SPARSEQR_COMPATIBLE
else if (qrAlgorithm == EigenSparseQR) {
#ifdef PROFILE_DIAGNOSE
Base::TimeInfo SparseQR_start_time;
Base::TimeElapsed SparseQR_start_time;
#endif
if (J.rows() > 0) {
int rank = 0;
@@ -5178,9 +5178,9 @@ int System::diagnose(Algorithm alg)
}
#ifdef PROFILE_DIAGNOSE
Base::TimeInfo SparseQR_end_time;
Base::TimeElapsed SparseQR_end_time;
auto SolveTime = Base::TimeInfo::diffTimeF(SparseQR_start_time, SparseQR_end_time);
auto SolveTime = Base::TimeElapsed::diffTimeF(SparseQR_start_time, SparseQR_end_time);
Base::Console().Log("\nSparseQR - Lapsed Time: %f seconds\n", SolveTime);
#endif