diff options
Diffstat (limited to 'editor/script_editor_debugger.cpp')
-rw-r--r-- | editor/script_editor_debugger.cpp | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index c3b62810f1..3b086c6316 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -727,20 +727,8 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da String tt = vs; switch (Performance::MonitorType((int)perf_items[i]->get_metadata(1))) { case Performance::MONITOR_TYPE_MEMORY: { - // for the time being, going above GBs is a bad sign. - String unit = "B"; - if ((int)v > 1073741824) { - unit = "GB"; - v /= 1073741824.0; - } else if ((int)v > 1048576) { - unit = "MB"; - v /= 1048576.0; - } else if ((int)v > 1024) { - unit = "KB"; - v /= 1024.0; - } - tt += " bytes"; - vs = String::num(v, 2) + " " + unit; + vs = String::humanize_size(v); + tt = vs; } break; case Performance::MONITOR_TYPE_TIME: { tt += " seconds"; |