On Wed, 11 Jun 2008, Prof Brian Ripley wrote: > Bill Dunlap wrote: > > It might be nice if check could print the time it took to do > > each test. > > That's an existing request for various parts of the checking procedure. > When the time to run a package check jumps up, it is sometimes tedious to > find out where the time went. But the tests are currently scripted by > make, so difficult to produce timings portably.
In Splus, if you set options(verbose=TRUE), then the time for each top level expression is printed to stdout (or to a log file, depending on other options). The Time: line tells which top level expression it refers to and whether the expression succeeded or failed. E.g., > options(verbose=TRUE) Time: Task #2 succeeded (Seconds = 0.01 CPU, 0.01 elapsed) > for(i in 1:1e5)log(i) Time: Task #3 succeeded (Seconds = 1.49 CPU, 1.5 elapsed) > for(i in 1:1e5) if (i==1e5) stop("i is too big") else log(i) Error: Problem: i is too big Problem: i is too big Use traceback() to see the call stack Time: Task #4 failed (Seconds = 3.18 CPU, 3.2 elapsed) If R had this sort of logging then check could turn it on when desired. Splus also uses this logging mechanism to log calls to read.table() and inputData(), to record the initial value of .Random.seed, etc., so one can run a perl script over the log file for a batch run to see if there were significant problems and have enough information to reproduce the problems found. ---------------------------------------------------------------------------- Bill Dunlap Insightful Corporation bill at insightful dot com "All statements in this message represent the opinions of the author and do not necessarily reflect Insightful Corporation policy or position." ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel