This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Time to switch from "false" to "true"!
#2
delta variable will have the time between FALSE and TRUE values in seconds.
Code:
value = event.getvalue()

if value then
  prevtime = storage.get('prevtime')
  
  if prevtime then
    storage.delete('prevtime')
    delta = os.udifftime(unpack(prevtime))
    log(delta)
  end
else
  storage.set('prevtime', { os.microtime() })
end
Reply


Messages In This Thread
RE: Time to switch from "false" to "true"! - by admin - 11.11.2019, 08:23

Forum Jump: