Details and Options
While the basic function
Pause halts code execution for a certain number of seconds,
ResourceFunction["PauseUntil"] halts it until a certain given time occurs.
ResourceFunction["PauseUntil"] accepts the following options:
| TimeZone | Automatic | the time zone used in all the internal evaluations |
| "PauseInformation" | False | whether to Echo the time to be paused |
| "Periodicity" | None | consider the input as a periodically repeating time |
There is no output for
ResourceFunction["PauseUntil"], but the time to be waited for can be echoed by setting the option
"PauseInformation" to
True.
The values for the option "Periodicity" can be:
| None | pause until only the specified time |
| n | pause until the next occurrence of the given time repeated in the future every n days |
| {n,unit} | pause until the next occurrence of the given time repeated in the future every n integer units of time |
The unit in the
"Periodicity" option value can be one of the following:
"Year",
"Quarter",
"Month",
"Week",
"Day",
"Hour",
"Minute",
"Second",
"Weekday",
"Weekend",
Monday through
Sunday,
"EndOfMonth",
"BeginningOfMonth" and
"BusinessDay".
Normally, entering as input past times leads to failure, unless the option "Periodicity" is set. Then a past date or time is interpreted as periodically repeating every n*unit time in the future and the evaluation pauses until the next occurrence of such periodic date.
A potential application of ResourceFunction["PauseUntil"] is for setting up scheduled tasks running at fixed times, especially on remote servers using the .
Other use cases include API rate limiting, external coordination, simulations or demonstrations.