wait_till: Planned sleep times

Description Usage Arguments Examples

View source: R/utils.R

Description

Pause the execution of a script either until a certain time is reached, or until a specified amount of time has passed.

Usage

1
Takes either `resume` OR a combination of `from` and `seconds`.

Arguments

from

A datetime object, when the beginning of the sleep interval.

resume

A datetime object, representing when the script shall resume.

seconds

An integer, representing the amount of seconds to wait.

Examples

1
2
3
4
5
6
7
8
9
# Continue script after 20:30:34 on November 14th 2020

continue_at <- lubridate::as_datetime("2020-11-14 20:30:34")
wait_till(resume = continue_at, seconds = 12)

# Continue script 12 seconds after the last call was made

last_timestamp <- lubridate::now()
wait_till(from = last_timestamp, seconds = 12)

schliebs/rtangle documentation built on Dec. 22, 2021, 10:22 p.m.