20 void StartSetup() { m_setupStartTime = std::chrono::system_clock::now(); }
26 m_setupDuration = std::chrono::system_clock::now() - m_setupStartTime;
32 void StartSolve() { m_solveStartTime = std::chrono::system_clock::now(); }
39 auto now = std::chrono::system_clock::now();
40 ++m_solveMeasurements;
41 m_averageSolveDuration =
42 (m_solveMeasurements - 1.0) / m_solveMeasurements *
43 m_averageSolveDuration +
44 1.0 / m_solveMeasurements * (now - m_solveStartTime);
51 using std::chrono::duration_cast;
52 using std::chrono::nanoseconds;
53 return duration_cast<nanoseconds>(m_setupDuration).count() / 1e6;
65 using std::chrono::duration_cast;
66 using std::chrono::nanoseconds;
67 return duration_cast<nanoseconds>(m_averageSolveDuration).count() / 1e6;
71 std::chrono::system_clock::time_point m_setupStartTime;
72 std::chrono::duration<double> m_setupDuration{0.0};
74 int m_solveMeasurements = 0;
75 std::chrono::duration<double> m_averageSolveDuration{0.0};
76 std::chrono::system_clock::time_point m_solveStartTime;
#define SLEIPNIR_DLLEXPORT
Definition SymbolExports.hpp:34
Records the number of profiler measurements (start/stop pairs) and the average duration between each ...
Definition Profiler.hpp:15
void StopSolve()
Tell the profiler to stop measuring solve time, increment the number of averages, and incorporate the...
Definition Profiler.hpp:38
void StartSetup()
Tell the profiler to start measuring setup time.
Definition Profiler.hpp:20
double SetupDuration() const
The setup duration in milliseconds as a double.
Definition Profiler.hpp:50
int SolveMeasurements() const
The number of solve measurements taken.
Definition Profiler.hpp:59
double AverageSolveDuration() const
The average solve duration in milliseconds as a double.
Definition Profiler.hpp:64
void StartSolve()
Tell the profiler to start measuring solve time.
Definition Profiler.hpp:32
void StopSetup()
Tell the profiler to stop measuring setup time.
Definition Profiler.hpp:25
Definition Hessian.hpp:18