IoT Open Tech
Home
  • Platform
  • Modules
  • Devices
Guides
Changelog
  • English
  • Svenska
Home
  • Platform
  • Modules
  • Devices
Guides
Changelog
  • English
  • Svenska
  • Platform

    • IoT Open Lynx Platform
    • Lynx Architecture
    • Main objects
    • DeviceX / FunctionX
    • Metadata
      • Known meta-keys
    • Icons
    • Schedules
    • Edge Apps
      • The app.json file
      • Package lynx
      • Package timer
      • Package json
      • Package mq
      • Package log
      • Package edge
    • Notifications
      • Templating language
      • Executors
    • Events
    • Permissions
    • API Reference and Libraries

Package timer

Functions

interval

Execute function every x seconds indefinitely. If the function executed returns false the timer is removed.

Example

function doAgain()
    print("Executing...")
end

local t = timer:interval(5, doAgain)

after

Execute specified function after x seconds.

Parameters

NameOptionalDescription
TimeNoTime in seconds
FunctionNoFunction to execute after time

Example

function doLater()
    print("Doing after 10 seconds")
end

local t = timer:after(10, doLater)

timer object

The timer functions return an object for that specific timer. It can be used to cancel the timer.

Example

The timer will be stopped immediately without execution.

function doLater()
    print("Doing after 10 seconds")
end

local t = timer:after(10, doLater)
t:cancel()
Last updated:
Prev
Package lynx
Next
Package json