R/timeEval.R

Defines functions timeEval

Documented in timeEval

timeEval =
function(code, envir = globalenv(), verbose = TRUE, ...)
{
    if(is.character(code)) {
        if(file.exists(code))
            code = parse(code)
        else
            code = parse(text = code)
    }

    times = lapply(code, function(x) {
                            if(verbose)
                                print(deparse(x))
                            system.time(eval(x, envir))
                        })

    names(times) = sapply(code, function(x) paste(deparse(x), collapse = " "))
    times
}
    
duncantl/CallCounter documentation built on Jan. 20, 2020, 5:16 a.m.