@@ -75,9 +75,9 @@ core.register_on_chat_message(function(name, message)
75
75
local has_privs , missing_privs = core .check_player_privs (name , cmd_def .privs )
76
76
if has_privs then
77
77
core .set_last_run_mod (cmd_def .mod_origin )
78
- local t_before = minetest .get_us_time ()
78
+ local t_before = core .get_us_time ()
79
79
local success , result = cmd_def .func (name , param )
80
- local delay = (minetest .get_us_time () - t_before ) / 1000000
80
+ local delay = (core .get_us_time () - t_before ) / 1000000
81
81
if success == false and result == nil then
82
82
core .chat_send_player (name , " -!- " .. S (" Invalid command usage." ))
83
83
local help_def = core .registered_chatcommands [" help" ]
@@ -91,11 +91,12 @@ core.register_on_chat_message(function(name, message)
91
91
if delay > msg_time_threshold then
92
92
-- Show how much time it took to execute the command
93
93
if result then
94
- result = result ..
95
- minetest . colorize ( " #f3d2ff " , " (%.5g s) " ): format ( delay )
94
+ result = result .. core . colorize ( " #f3d2ff " , S ( " (@1 s) " ,
95
+ string.format ( " %.5f " , delay )) )
96
96
else
97
- result = minetest .colorize (" #f3d2ff" ,
98
- " Command execution took %.5f s" ):format (delay )
97
+ result = core .colorize (" #f3d2ff" , S (
98
+ " Command execution took @1 s" ,
99
+ string.format (" %.5f" , delay )))
99
100
end
100
101
end
101
102
if result then
0 commit comments