You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Display times as milliseconds in the profiler and performance monitors
Small values are easier to read as milliseconds compared to seconds.
(cherry picked from commit f1d9dbfb08)
This commit is contained in:
committed by
Rémi Verschelde
parent
611cc11536
commit
6e56d04616
@@ -806,25 +806,25 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
|
||||
p.write[i] = arr[i];
|
||||
if (i < perf_items.size()) {
|
||||
|
||||
float v = p[i];
|
||||
String vs = rtos(v);
|
||||
String tt = vs;
|
||||
const float value = p[i];
|
||||
String label = rtos(value);
|
||||
String tooltip = label;
|
||||
switch (Performance::MonitorType((int)perf_items[i]->get_metadata(1))) {
|
||||
case Performance::MONITOR_TYPE_MEMORY: {
|
||||
vs = String::humanize_size(v);
|
||||
tt = vs;
|
||||
label = String::humanize_size(value);
|
||||
tooltip = label;
|
||||
} break;
|
||||
case Performance::MONITOR_TYPE_TIME: {
|
||||
tt += " seconds";
|
||||
vs += " s";
|
||||
label = rtos(value * 1000).pad_decimals(2) + " ms";
|
||||
tooltip = label;
|
||||
} break;
|
||||
default: {
|
||||
tt += " " + perf_items[i]->get_text(0);
|
||||
tooltip += " " + perf_items[i]->get_text(0);
|
||||
} break;
|
||||
}
|
||||
|
||||
perf_items[i]->set_text(1, vs);
|
||||
perf_items[i]->set_tooltip(1, tt);
|
||||
perf_items[i]->set_text(1, label);
|
||||
perf_items[i]->set_tooltip(1, tooltip);
|
||||
if (p[i] > perf_max[i])
|
||||
perf_max.write[i] = p[i];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user