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

Display used CPUs as range, if possible.

This commit is contained in:
Bartosz Taudul
2020-04-24 02:02:16 +02:00
parent 170aeea864
commit 747f26ef74
2 changed files with 27 additions and 1 deletions
+26 -1
View File
@@ -6437,7 +6437,32 @@ void View::DrawZoneInfoWindow()
}
else
{
ImGui::Text( "%i,", i );
int consecutive = 1;
int remaining = numCpus;
for(;;)
{
if( cpus[i+consecutive] == 0 ) break;
consecutive++;
if( --remaining == 0 ) break;
}
if( consecutive > 2 )
{
if( remaining == 0 )
{
ImGui::Text( "%i \xE2\x80\x93 %i", i, i+consecutive-1 );
break;
}
else
{
ImGui::Text( "%i \xE2\x80\x93 %i,", i, i+consecutive-1 );
i += consecutive - 1;
numCpus = remaining;
}
}
else
{
ImGui::Text( "%i,", i );
}
}
}
}