1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Display standard deviation.

This commit is contained in:
Bartosz Taudul
2019-03-14 01:14:06 +01:00
parent d64f07f853
commit d3fdd6b1d1
2 changed files with 21 additions and 0 deletions
+20
View File
@@ -6027,6 +6027,26 @@ void View::DrawFindZone()
ImGui::Spacing();
ImGui::SameLine();
TextFocused( "Median time:", TimeToString( m_findZone.median ) );
if( m_findZone.sorted.size() > 1 )
{
const auto avg = m_findZone.average;
double ss = 0;
for( auto& v : m_findZone.sorted )
{
const auto d = double( v ) - avg;
ss += d*d;
}
const auto sd = sqrt( ss / ( m_findZone.sorted.size() - 1 ) );
ImGui::SameLine();
ImGui::Spacing();
ImGui::SameLine();
#ifdef TRACY_EXTENDED_FONT
TextFocused( "\xcf\x83:", TimeToString( sd ) );
#else
TextFocused( "s:", TimeToString( sd ) );
#endif
}
TextDisabledUnformatted( "Selection range:" );
ImGui::SameLine();