Skip to content

Instantly share code, notes, and snippets.

Lua Compatibility Matrix

No: This function or field will be missing in this version.
Yes: This function or field is supported unconditionally in this version.
Maybe: This function or field is behind a LUA_COMPAT_* define and may or may not be available.

Feature Lua 5.1 Lua 5.2 Lua 5.3 Lua 5.4
Base Library
assert(v, [msg]) Yes Yes Yes Yes
@truemedian
truemedian / clock_gettime.lua
Last active February 28, 2025 21:14
Windows / Posix compatible clock_gettime(REALTIME) ffi bindings.
local ffi = require 'ffi'
local bit = require 'bit'
local clock_gettime
if ffi.os == 'Windows' then
local UNIX_TIME_START = 0x019DB1DED53E8000LL
local TICKS_PER_SECOND = 10000000LL
ffi.cdef [[