mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Reduced the CPU usage of the sent block selector algorithm
This commit is contained in:
parent
16fdb42590
commit
223b379348
11 changed files with 355 additions and 55 deletions
19
src/game.cpp
19
src/game.cpp
|
@ -903,6 +903,10 @@ void the_game(
|
|||
|
||||
bool first_loop_after_window_activation = true;
|
||||
|
||||
// TODO: Convert the static interval timers to these
|
||||
// Interval limiter for profiler
|
||||
IntervalLimiter m_profiler_interval;
|
||||
|
||||
// Time is in milliseconds
|
||||
// NOTE: getRealTime() causes strange problems in wine (imprecision?)
|
||||
// NOTE: So we have to use getTime() and call run()s between them
|
||||
|
@ -1089,6 +1093,21 @@ void the_game(
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Profiler
|
||||
*/
|
||||
float profiler_print_interval =
|
||||
g_settings.getFloat("profiler_print_interval");
|
||||
if(profiler_print_interval != 0)
|
||||
{
|
||||
if(m_profiler_interval.step(0.030, profiler_print_interval))
|
||||
{
|
||||
dstream<<"Profiler:"<<std::endl;
|
||||
g_profiler.print(dstream);
|
||||
g_profiler.clear();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Direct handling of user input
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue