This util class provides an easy way to keep track of iterations per second for any body of code.
More...
#include <IPS.hpp>
|
| | IPS () |
| | Construct a new IPS object.
|
| | ~IPS () |
| | Construct a new IPS object.
|
| IPS & | operator= (const IPS &OtherIPS) |
| | Operator equals for IPS class.
|
| void | Tick () |
| | This method is used to update the iterations per second counter and recalculate all of the IPS metrics.
|
| double | GetExactIPS () const |
| | Accessor for the Current I P S private member. This method will return the immediate IPS since the last Tick() call. If called in a loop, this number will likely jump around greatly. If you want a 'smoother' IPS number then call the GetAverageIPS() method.
|
| double | GetAverageIPS () const |
| | Calculates the average iterations per second.
|
| double | GetHighestIPS () const |
| | Accessor for the Highest I P S private member.
|
| double | GetLowestIPS () const |
| | Accessor for the Lowest I P S private member.
|
| double | Get1PercentLow () const |
| | Accessor for the 1PercentLow I P S private member.
|
| void | Reset () |
| | Resets all metrics and frame time history.
|
|
| void | UpdateMetrics () |
| | This method is used to calculate the IPS stats. Highest, lowest, and 1 percent low IPS.
|
This util class provides an easy way to keep track of iterations per second for any body of code.
- Author
- ClayJay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
- Date
- 2023-08-17
◆ IPS()
◆ ~IPS()
◆ Get1PercentLow()
| double IPS::Get1PercentLow |
( |
| ) |
const |
|
inline |
◆ GetAverageIPS()
| double IPS::GetAverageIPS |
( |
| ) |
const |
|
inline |
Calculates the average iterations per second.
- Returns
- double - The average iterations per second according to the metrics window.
- Author
- ClayJay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
- Date
- 2023-08-17
184 {
185
187 {
188
189 return 0.0;
190 }
191
192
193 double dSum = 0.0;
195 {
196
197 dSum += dVal;
198 }
199
200
202 }
std::deque< double > m_dqIPSHistory
Definition IPS.hpp:40
◆ GetExactIPS()
| double IPS::GetExactIPS |
( |
| ) |
const |
|
inline |
◆ GetHighestIPS()
| double IPS::GetHighestIPS |
( |
| ) |
const |
|
inline |
◆ GetLowestIPS()
| double IPS::GetLowestIPS |
( |
| ) |
const |
|
inline |
◆ operator=()
| IPS & IPS::operator= |
( |
const IPS & | OtherIPS | ) |
|
|
inline |
◆ Reset()
◆ Tick()
This method is used to update the iterations per second counter and recalculate all of the IPS metrics.
- Author
- ClayJay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
- Date
- 2023-08-17
142 {
143
144 auto tCurrentTime = std::chrono::high_resolution_clock::now();
145 auto tElapsedTimeSinceLastTick = std::chrono::duration_cast<std::chrono::microseconds>(tCurrentTime -
m_tLastUpdateTime).count();
146
147
149
150
152
153
155 }
std::chrono::high_resolution_clock::time_point m_tLastUpdateTime
Definition IPS.hpp:41
void UpdateMetrics()
This method is used to calculate the IPS stats. Highest, lowest, and 1 percent low IPS.
Definition IPS.hpp:54
◆ UpdateMetrics()
| void IPS::UpdateMetrics |
( |
| ) |
|
|
inlineprivate |
◆ m_d1PercentLow
| double IPS::m_d1PercentLow |
|
private |
◆ m_dCurrentIPS
| double IPS::m_dCurrentIPS |
|
private |
◆ m_dHighestIPS
| double IPS::m_dHighestIPS |
|
private |
◆ m_dLowestIPS
◆ m_dqIPSHistory
| std::deque<double> IPS::m_dqIPSHistory |
|
private |
◆ m_nMaxMetricsHistorySize
| const long unsigned int IPS::m_nMaxMetricsHistorySize = 100 |
|
private |
◆ m_tLastUpdateTime
| std::chrono::high_resolution_clock::time_point IPS::m_tLastUpdateTime |
|
private |
The documentation for this class was generated from the following file: