Description Usage Arguments Value Examples
View source: R/timer_function.R
This is a modified version of the timeR package for an internal use. 
Full credit is to Yifu Yan, the author of the timeR package.
createTimer creates a timer object.
getTimer returns a data frame with all records saved by the timer 
object. Columns in the data.frame are: event, start, end, duration, RMSE, 
MAE, stars, params, comment.
1 2 3  | createTimer(verbose = TRUE)
getTimer(object)
 | 
verbose | 
 A parameter to control whether to print messages while using
methods. Default to   | 
object | 
 The name for timer object.  | 
An (invisible) object of R6 class for createTimer. A data.frame for 
getTimer.
1 2 3 4 5 6 7 8 9 10 11 12 13 14  | ## Create a timer object. Record events. Get all records.
timeTT <- createTimer(FALSE) # print is disabled
timeTT <- createTimer()      # print is enabled
timeTT$start("event1")
Sys.sleep(1)
timeTT$stop("event1", RMSE = 1, MAE = 1.3, stars = "*", 
            params = "maxiter=100, lr=0.01", comment = "OK for 1",  
            printmsg = TRUE)
timeTT$start("event2")
Sys.sleep(2)
timeTT$stop("event2", RMSE = 2, MAE = 2.6, stars = "**",  
            params = "maxiter=1000, lr=0.001", comment = "OK for 2",  
            printmsg = FALSE)
getTimer(timeTT)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.