Skip to contents

A small wrapper around Sys.sleep() that adds a progress bar.

Usage

sys_sleep(time, ..., message = "Sleeping...", .progress = TRUE)

Arguments

time

the amount of time (in seconds) to sleep

...

additional parameters passed to cli::cli_progress_bar()

message

a message to display alongside the progress bar

.progress

whether or not to sleep with a progress bar. Defaults to TRUE.

Examples

# sleep with a progress bar
sys_sleep(3)
#> Sleeping... ■■■■■■■■■■■                       33% | ETA:  2s
#> Sleeping... ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■  100% | ETA:  0s