drake (version 6.2.1)

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

Description

Listed times do not include the amount of time spent loading and saving objects! See the type argument for different versions of the build time. (You can choose whether to take storage time into account.)

Usage

build_times(..., path = getwd(), search = TRUE, digits = 3,
  cache = get_cache(path = path, search = search, verbose = verbose),
  targets_only = FALSE, verbose = drake::default_verbose(), jobs = 1,
  type = c("build", "command"))

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

logical, whether to only return the build times of the targets (exclude the imports).

verbose

logical or numeric, control printing to the console. Use pkgconfig to set the default value of verbose for your R session: for example, pkgconfig::set_config("drake::verbose" = 2).

  • 0 or FALSE: print nothing.

  • 1 or TRUE: print only targets to build.

  • 2: also print checks and cache info.

  • 3: also print any potentially missing items.

  • 4: also print imports and writes to the cache.

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.

Value

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

See Also

built()

Examples

Run this code
# NOT RUN {
test_with_dir("Quarantine side effects.", {
# 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.
build_times() # Show how long it took to build each target.
})
# }

Run the code above in your browser using DataLab