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

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

Package edge.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 edge.lynx
Next
Package json