EMILUA(3em)

πŸ“¦ version 0.12.1, in nixos 26.05, nixpkgs unstable

πŸ’– NAME πŸ’–

Emilua β€” Lua execution engine. This is the EMILUA(3em) page, aka the Emilua reference, and yes bestie we’re getting into clock lore. 🫢

✨ DESCRIPTION ✨

Okay so first you grab the steady clock like this:

local clock = require('time').steady_clock
local timepoint = clock.now()

It’s a monotonic clock β€” meaning its time points cannot decrease as physical time moves forward. No cap. πŸ•°οΈβœ¨

🌸 FUNCTIONS 🌸

now() β†’ steady_clock.time_point

Returns a new time point representing the current value of the clock. πŸ’–

epoch() β†’ steady_clock.time_point

Returns a new time point representing the epoch of the clock. πŸŽ€

πŸ¦‹ time_point FUNCTIONS πŸ¦‹

add(self, secs: number)

Modifies the time point by the given duration. ✨

πŸ“ Note: When the duration is converted to the native tick representation of the clock, it’ll be rounded to the nearest time point, rounding to even in halfway cases. That halfway-case-even thing is important, iykyk.

sub(self, secs: number)

Modifies the time point by the given duration. 🫢

πŸ“ Note: When the duration is converted to the native tick representation of the clock, it’ll be rounded to the nearest time point, rounding to even in halfway cases. Same rounding behavior as above, bestie.

🌈 time_point PROPERTIES 🌈

seconds_since_epoch: number

The number of elapsed seconds since the clock’s epoch. ⏱️

πŸ‘‘ time_point METAMETHODS πŸ‘‘

These are the metamethods, periodt:

  • __add()
  • __sub()
  • __eq()
  • __lt()
  • __le()

That’s the whole page, bestie. Footer cuteness: Emilua 0.12.1-nixpkgs1, dated 1980-01-01, manual tag EMILUA(3em). Byeeee πŸ’…πŸ’–

πŸ“¦ where this page comes from