From 49a1a8d2f3e9913f3addac21c8d360f3fcebf61e Mon Sep 17 00:00:00 2001 From: osmarks Date: Fri, 27 Jul 2018 11:57:28 +0100 Subject: [PATCH] Cosmetic improvements --- backend-chests.lua | 2 +- lib.lua | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/backend-chests.lua b/backend-chests.lua index 5ca3fa8..3cb9c42 100644 --- a/backend-chests.lua +++ b/backend-chests.lua @@ -46,7 +46,7 @@ local function update_index_for(name) index[name] = data - print("Indexed", name) + print("Indexed", name, ".") end -- Reindex all connected inventories diff --git a/lib.lua b/lib.lua index b1a3c8a..1eb099a 100644 --- a/lib.lua +++ b/lib.lua @@ -82,6 +82,10 @@ local function init_screen(scr, bg, fg) scr.clear() end +local function round_to_tenth(t) + return math.round(t*10)*0.1 +end + -- Runs a Wyvern node server. -- First argument is a function to be run for requests. It will be provided the request data and must return the value to respond with. -- If it errors, an internal error will be returned. @@ -124,7 +128,7 @@ local function serve(fn, node_type) else local end_time = os.clock() print("Response:", textutils.serialise(result)) - print("Time:", tostring(end_time - start_time)) + print("Time:", tostring(round_to_tenth(end_time - start_time))) response = { type = "response", response = result } end else