drake (version 7.3.0)

build_times: List the time it took to build each target.

Description

Applies to targets in your plan, not imports or files.

Usage

build_times(..., path = getwd(), search = TRUE, digits = 3,
  cache = get_cache(path = path, search = search, verbose = verbose),
  targets_only = NULL, verbose = 1L, jobs = 1, type = c("build",
  "command"), list = character(0))

Arguments

...

Targets to load from the cache: as names (symbols) or character strings. If the tidyselect package is installed, you can also supply dplyr-style tidyselect commands such as starts_with(), ends_with(), and one_of().

path

Root directory of the drake project, or if search is TRUE, either the project root or a subdirectory of the project. Ignored if a cache is supplied.

search

Logical. If TRUE, search parent directories to find the nearest drake cache. Otherwise, look in the current working directory only. Ignored if a cache is supplied.

digits

How many digits to round the times to.

cache

drake cache. See new_cache(). If supplied, path and search are ignored.

targets_only

Deprecated.

verbose

Integer, control printing to the console/terminal.

  • 0: print nothing.

  • 1: print targets, retries, and failures.

  • 2: also show a spinner when preprocessing tasks are underway.

jobs

Number of jobs/workers for parallel processing.

type

Type of time you want: either "build" for the full build time including the time it took to store the target, or "command" for the time it took just to run the command.

list

Character vector of targets to select.

Value

A data frame of times, each from system.time().

See Also

predict_runtime()

Examples

Run this code
# NOT RUN {
isolate_example("Quarantine side effects.", {
if (suppressWarnings(require("knitr"))) {
if (requireNamespace("lubridate")) {
# Show the build times for the mtcars example.
load_mtcars_example() # Get the code with drake_example("mtcars").
make(my_plan) # Build all the targets.
print(build_times()) # Show how long it took to build each target.
}
}
})
# }

Run the code above in your browser using DataLab