#
hs.timer
Execute functions with various timing rules
NOTE: timers use NSTimer internally, which will be paused when computers sleep. Especially, repeating timers won't be triggered at the specified time when there are sleeps in between. The workaround is to prevent system from sleeping, configured in Energy Saver in System Preferences.
#
Submodules
#
API Overview
Functions - API calls offered directly by the extension
absoluteTime days hours localTime minutes seconds secondsSinceEpoch usleep weeks
Constructors - API calls which return an object, typically one that offers API methods
doAfter doAt doEvery doUntil doWhile new waitUntil waitWhile
Methods - API calls which can only be made on an object returned by a constructor
fire nextTrigger running setNextTrigger start stop
#
API Documentation
#
Functions
#
absoluteTime
#
days
#
hours
#
localTime
#
minutes
#
seconds
| | |
| --------------------------------------------|-------------------------------------------------------------------------------------|
| Signature | hs.timer.seconds(timeOrDuration) -> seconds
|
| Type | Function |
| Description | Converts a string with a time of day or a duration into number of seconds |
| Parameters |
- timeOrDuration - a string that can have any of the following formats: "HH:MM:SS" or "HH:MM" - represents a time of day (24-hour clock), returns the number of seconds since midnight "DDdHHh", "HHhMMm", "MMmSSs", "DDd", "HHh", "MMm", "SSs", "NNNNms" - represents a duration in days, hours, minutes, seconds and/or milliseconds
- The number of seconds