From 43c9ce4a9bcb30e055429f68e88ffae8fd9def94 Mon Sep 17 00:00:00 2001 From: zwim <36999612+zwim@users.noreply.github.com> Date: Mon, 17 Jun 2024 16:03:48 +0200 Subject: [PATCH] [time] Fix typos in documentation --- frontend/ui/time.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/frontend/ui/time.lua b/frontend/ui/time.lua index b5b6c8cb6..8e6dcc4b1 100644 --- a/frontend/ui/time.lua +++ b/frontend/ui/time.lua @@ -77,9 +77,9 @@ All other time variables (a handful) get the appropriate suffix `_ms`, `_us`, `_ local start_time = time.now() -- Do some stuff. - -- You can add and subtract `fts times` objects. - local duration = time.now() - start.fts - -- And convert that object to various more human-readable formats, e.g., + -- You can add and subtract `fts times` objects + local duration = time.now() - start_time + -- and convert that object to various more human-readable formats, e.g., print(string.format("Stuff took %.3fms", time.to_ms(duration))) local offset = time.s(100) @@ -107,25 +107,25 @@ local FTS2US = 1 / US2FTS -- Fixed point time local time = {} ---- Sometimes we need a very large time +--- Sometimes we need a very large time. time.huge = math.huge ---- Creates a time (fts) from a number in seconds +--- Creates a time (fts) from a number in seconds. function time.s(seconds) return math.floor(seconds * S2FTS) end ---- Creates a time (fts) from a number in milliseconds +--- Creates a time (fts) from a number in milliseconds. function time.ms(msec) return math.floor(msec * MS2FTS) end ---- Creates a time (fts) from a number in microseconds +--- Creates a time (fts) from a number in microseconds. function time.us(usec) return math.floor(usec * US2FTS) end ---- Creates a time (fts) from a structure similar to timeval +--- Creates a time (fts) from a structure similar to timeval. function time.timeval(tv) return tv.sec * S2FTS + tv.usec * US2FTS end @@ -159,7 +159,7 @@ end --[[-- Compare a past *MONOTONIC* fts time to *now*, returning the elapsed time between the two. (sec.usecs variant) -Returns a Lua (decimal) number (sec.usecs, with decimal places) (accurate to the µs) +Returns a Lua (decimal) number (sec.usecs, with decimal places) (accurate to the µs). ]] function time.since(start_time) -- Time difference