human

Run Settings
LanguageLua
Language Version
Run Command
local function human(n) if n == 0 or n >= 1 then return n.." s" elseif n >= 1e-3 then return (n*1e3).." ms" else return (n*1e6).." µs" end end assert(human(0) == "0 s") assert(human(1) == "1 s") assert(human(0.1) == "100 ms") assert(human(0.001) == "1 ms") assert(human(0.0001) == "100 µs") assert(human(0.000001) == "1 µs") assert(human(0.0000001) == "0.1 µs")
Editor Settings
Theme
Key bindings
Full width
Lines