Skip to content

time_seconds

Return a monotonic clock reading in seconds. Subtract two readings for elapsed time.

Takes no arguments.

local start = time_seconds()
-- later:
print(time_seconds() - start)

Related: rand.

See the runner timing guide for more examples and limits.