Skip to content

Instantly share code, notes, and snippets.

@ophentis
Created December 24, 2014 02:42
Show Gist options
  • Save ophentis/db691586d0b9b3afba2d to your computer and use it in GitHub Desktop.
Save ophentis/db691586d0b9b3afba2d to your computer and use it in GitHub Desktop.
onep lua - looping through datasource
local devices = alias['devices_cp']
-- reset last pointer
devices.last = 0
local value = true
local count = 0
local ts = now
while count < 1000 and value do
-- counting
value = devices.wait(ts)
count = count + 1
end
debug('elapsed' .. tostring(now-ts) .. 'seconds')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment