mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +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:
parent
611cc11536
commit
6e56d04616
2 changed files with 23 additions and 27 deletions
|
@ -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];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue