summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2021-04-08 23:03:30 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2021-04-09 14:59:10 +0200
commit157d8e4d36b5286146554aedda0e286056bbe32c (patch)
tree87649cfa3cf2aec9a2037a8f7d7856d2fe5b8905
parentcba3b024b5d08b79e4389dc2c374e38ab4a64ff9 (diff)
Improve command line `--print-fps` display
- Display the frame time in addition to FPS. - Frame time is a more objective measurement in comparison to FPS, but FPS is more familiar to people less acquainted with profiling. - Rename "Game" to "Project" for the project FPS printing line.
-rw-r--r--main/main.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 4635d377c4..4103fad17c 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -2537,10 +2537,10 @@ bool Main::iteration() {
if (frame > 1000000) {
if (editor || project_manager) {
if (print_fps) {
- print_line("Editor FPS: " + itos(frames));
+ print_line(vformat("Editor FPS: %d (%s mspf)", frames, rtos(1000.0 / frames).pad_decimals(1)));
}
} else if (GLOBAL_GET("debug/settings/stdout/print_fps") || print_fps) {
- print_line("Game FPS: " + itos(frames));
+ print_line(vformat("Project FPS: %d (%s mspf)", frames, rtos(1000.0 / frames).pad_decimals(1)));
}
Engine::get_singleton()->_fps = frames;