hammerspoon2-docs
    Preparing search index...

    Class HSTimer

    Object representing a timer. You should not instantiate these yourself, but rather, use the methods in hs.timer to create them for you.

    Index

    Constructors

    Properties

    interval: number

    The timer's interval in seconds

    repeats: boolean

    Whether the timer repeats

    Methods

    • Immediately fire the timer's callback

      Returns void

    • Get the number of seconds until the timer next fires

      Returns number

      Seconds until next trigger, or a negative value if the timer is not running

    • Check if the timer is currently running

      Returns boolean

      true if the timer is running, false otherwise

    • Set when the timer should next fire

      Parameters

      • seconds: number

        Number of seconds from now when the timer should fire

      Returns void

    • Start the timer

      Returns void

    • Stop the timer

      Returns void