mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-24 17:10:03 +00:00
* Initial commit * Add tests * Dedup observers * Handle filters on table creation * Handle Archetype deletion * Remove print * Fix type errors * Cleanup code * Manually inline code * Build terms for cached queries * Specialized cached query iterator * Remove shadowed variable * Inverse statement * Rework demo * Fix metatable * Use generalized iteration
19 lines
No EOL
254 B
Text
19 lines
No EOL
254 B
Text
local function interval(s)
|
|
local pin
|
|
|
|
local function throttle()
|
|
if not pin then
|
|
pin = os.clock()
|
|
end
|
|
|
|
local elapsed = os.clock() - pin > s
|
|
if elapsed then
|
|
pin = os.clock()
|
|
end
|
|
|
|
return elapsed
|
|
end
|
|
return throttle
|
|
end
|
|
|
|
return interval |