inst/samples/rec.R

f <- function(n) {
    n <- n - 1
    g(n)
}

g <- function(n) {
    if (n > 0)
        f(n)
    else
        0
}

h <- function(n) {
    for (i in 1 : n)
        f(100)
}

system.time(h(50000))

Try the proftools package in your browser

Any scripts or data that you put into this service are public.

proftools documentation built on July 8, 2020, 5:20 p.m.