Make cosmetic changes actually work
This commit is contained in:
parent
62d3b4f6c2
commit
0368084c62
6
lib.lua
6
lib.lua
@ -82,10 +82,6 @@ local function init_screen(scr, bg, fg)
|
|||||||
scr.clear()
|
scr.clear()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function round_to_tenth(t)
|
|
||||||
return math.round(t*10)*0.1
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Runs a Wyvern node server.
|
-- 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.
|
-- 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.
|
-- If it errors, an internal error will be returned.
|
||||||
@ -128,7 +124,7 @@ local function serve(fn, node_type)
|
|||||||
else
|
else
|
||||||
local end_time = os.clock()
|
local end_time = os.clock()
|
||||||
print("Response:", textutils.serialise(result))
|
print("Response:", textutils.serialise(result))
|
||||||
print("Time:", tostring(round_to_tenth(end_time - start_time)))
|
print("Time:", string.format("%.1f", end_time - start_time))
|
||||||
response = { type = "response", response = result }
|
response = { type = "response", response = result }
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user