# Creates a debugger instance.
debugger <- Debugger$new()
# Opening and closing debugs in multileveled function calls.
function1 <- function() {
debugger$open_debug("function1")
function2()
debuger$close_debug()
}
function2 <- function() {
debugger$open_debug("function2")
Sys.sleep(1)
debugger$close_debug()
}
# This will produce the following printout to the console after the
# function1 finishes
#
# - 'function1' (execution time 7 ms)
# - 'function2' (execution time 5 ms)
Run the code above in your browser using DataLab