R Under development (unstable) (2023-08-05 r84874 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > main <- function () + { + FILE <- tempfile(fileext = ".R") + on.exit(unlink(FILE), add = TRUE) + this.path:::.write.code(file = FILE, { + if (requireNamespace("microbenchmark")) { + invisible(loadNamespace("microbenchmark")) + invisible(loadNamespace("this.path")) + print(this.path:::.faster.subsequent.times.test()) + } else cat("\npackage {microbenchmark} is not available :(\n") + }) + cat("\n") + this.path:::.Rscript(c("--default-packages=NULL", "--vanilla", FILE)) + + + cat("\n> source(FILE, chdir = FALSE)\n") + source(FILE, chdir = FALSE) + + + cat("\n> source(FILE, chdir = TRUE)\n") + source(FILE, chdir = TRUE) + } > > > main() "D:/RCompile/recent/R/bin/x64/Rscript.exe" "--default-packages=NULL" "--vanilla" "D:\temp\Rtmp0ekL7d\file3e3c5ca4de1.R" Loading required namespace: microbenchmark Unit: microseconds expr min lq mean median uq max neval first time 626.1 626.1 626.100 626.1 626.1 626.1 1 subsequent 4.8 4.9 5.045 4.9 5.0 15.8 100 > source(FILE, chdir = FALSE) Loading required namespace: microbenchmark Unit: microseconds expr min lq mean median uq max neval first time 631.9 631.9 631.900 631.9 631.9 631.9 1 subsequent 5.9 6.0 6.177 6.0 6.1 16.2 100 > source(FILE, chdir = TRUE) Unit: microseconds expr min lq mean median uq max neval first time 607.3 607.3 607.300 607.3 607.3 607.3 1 subsequent 5.9 6.0 6.193 6.1 6.1 15.6 100 > > proc.time() user system elapsed 0.29 0.01 0.64