From 364534d1541eb5d013d2fa6657092c70afaf2cd8 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Wed, 5 Jan 2022 02:12:51 +0100 Subject: [PATCH] Debug mode: more benchmark precision --- src/gui.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui.lua b/src/gui.lua index a9b426e..0880a61 100644 --- a/src/gui.lua +++ b/src/gui.lua @@ -1461,7 +1461,7 @@ local function get_debug_grid(data, fs, full_height) end local function make_fs(player, data) - local start = debug_mode and os.clock() or nil + local start = debug_mode and core.get_us_time() or nil local fs = setmetatable({}, { __call = function(t, ...) @@ -1502,7 +1502,7 @@ local function make_fs(player, data) if debug_mode then get_debug_grid(data, fs, full_height) - msg(data.player_name, fmt("make_fs(): %.2f ms", (os.clock() - start) * 1000)) + msg(data.player_name, fmt("make_fs(): %.2f ms", (core.get_us_time() - start) / 1000)) msg(data.player_name, fmt("#fs elements: %u", #fs)) end