Skip to content

❗ This is a read-only mirror of the CRAN R package repository. timechecker — Visualization of Processing Time with Standard Output

Notifications You must be signed in to change notification settings

cran/timechecker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

❗ This is a read-only mirror of the CRAN R package repository. timechecker — Visualization of Processing Time with Standard Output

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages