mirror of https://github.com/minetest/minetest.git
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
61871358c2
|
@ -35,6 +35,7 @@ local function singleplayer_refresh_gamebar()
|
|||
for j=1,#gamemgr.games,1 do
|
||||
if ("game_btnbar_" .. gamemgr.games[j].id == key) then
|
||||
mm_texture.update("singleplayer", gamemgr.games[j])
|
||||
core.set_topleft_text(gamemgr.games[j].name)
|
||||
core.setting_set("menu_last_game",gamemgr.games[j].id)
|
||||
menudata.worldlist:set_filtercriteria(gamemgr.games[j].id)
|
||||
return true
|
||||
|
|
|
@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
Server build: servermain.cpp
|
||||
*/
|
||||
enum TimePrecision {
|
||||
PRECISION_SECONDS,
|
||||
PRECISION_SECONDS = 0,
|
||||
PRECISION_MILLI,
|
||||
PRECISION_MICRO,
|
||||
PRECISION_NANO
|
||||
|
|
|
@ -44,8 +44,17 @@ u32 TimeTaker::stop(bool quiet)
|
|||
}
|
||||
else
|
||||
{
|
||||
if(quiet == false)
|
||||
infostream<<m_name<<" took "<<dtime<<"ms"<<std::endl;
|
||||
if (!quiet) {
|
||||
static const char* const units[] = {
|
||||
"s" /* PRECISION_SECONDS */,
|
||||
"ms" /* PRECISION_MILLI */,
|
||||
"us" /* PRECISION_MICRO */,
|
||||
"ns" /* PRECISION_NANO */,
|
||||
};
|
||||
infostream << m_name << " took "
|
||||
<< dtime << units[m_precision]
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
m_running = false;
|
||||
return dtime;
|
||||
|
|
Loading…
Reference in New Issue