Visualization of Processing Time with Standard Output

Displays processing time in a clear and structured way. One function supports iterative workflows by predicting and showing the total time required, while another reports the time taken for individual steps within a process.


timechecker: An R package to visualize processing time with standard output

Installation

devtools::install_github('YT100100/timechecker')

Usage

This package consists of two functions. set_loop_timechecker function returns a function, which visualizes the progress of iteration process.

iters <- 1:1000
ans <- NULL
tc <- set_loop_timechecker(length(iters))
for (i in iters) {
  ans <- c(ans, i)
  Sys.sleep(0.002)
  tc()
}

Demo movie of set_loop_timechecker function.

set_step_timechecker function also returns a function, which visualizes elapsed time in each processing step. This function is intended to be placed in a function.

f <- function() {

  tc <- set_step_timechecker()

  tc('Simulation')
  df <- data.frame(x = 1:10, y = 1:10 + rnorm(10))
  Sys.sleep(2)

  tc('Data augumentation')
  df$x2 <- df$x ^ 2
  df$x3 <- df$x ^ 3
  Sys.sleep(3)

  tc('Regression')
  lmres <- lm(y ~ ., df)
  Sys.sleep(4)

  tc()
  coef(lmres)

}
ans <- f()

Demo movie of set_step_timechecker function.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("timechecker")

1.1.5 by Toda Yusuke, 10 months ago


Browse source code at https://github.com/cran/timechecker


Authors: Toda Yusuke [aut, cre]


Documentation:   PDF Manual  


GPL-3 license


Suggests testthat


See at CRAN