diff options
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/main/main.cpp b/main/main.cpp index 190cdf3151..5736aedfe5 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -2964,6 +2964,7 @@ bool Main::is_iterating() { // For performance metrics. static uint64_t physics_process_max = 0; static uint64_t process_max = 0; +static uint64_t navigation_process_max = 0; bool Main::iteration() { //for now do not error on this @@ -2992,6 +2993,7 @@ bool Main::iteration() { uint64_t physics_process_ticks = 0; uint64_t process_ticks = 0; + uint64_t navigation_process_ticks = 0; frame += ticks_elapsed; @@ -3029,6 +3031,12 @@ bool Main::iteration() { } NavigationServer3D::get_singleton()->process(physics_step * time_scale); + uint64_t navigation_begin = OS::get_singleton()->get_ticks_usec(); + + NavigationServer3D::get_singleton()->process(physics_step * time_scale); + + navigation_process_ticks = MAX(navigation_process_ticks, OS::get_singleton()->get_ticks_usec() - navigation_begin); // keep the largest one for reference + navigation_process_max = MAX(OS::get_singleton()->get_ticks_usec() - navigation_begin, navigation_process_max); message_queue->flush(); @@ -3108,8 +3116,10 @@ bool Main::iteration() { Engine::get_singleton()->_fps = frames; performance->set_process_time(USEC_TO_SEC(process_max)); performance->set_physics_process_time(USEC_TO_SEC(physics_process_max)); + performance->set_navigation_process_time(USEC_TO_SEC(navigation_process_max)); process_max = 0; physics_process_max = 0; + navigation_process_max = 0; frame %= 1000000; frames = 0; |