On Fri, May 15, 2009 at 12:07 PM, Stavros Macrakis
<macra...@alum.mit.edu> wrote:
> system.time(whatseed(runif(1)))

Sorry, though I got lucky and my overall result is roughly correct,
this is an incorrect time measure.  It should be

    r <- runif(1); system.time(whatseed(r))

because R's call-by-need semantics don't evaluate the runif before it
starts running whatseed.  The correct time (on my machine) is then 28
hours, not 18.

Better to avoid side-effect functions as arguments....

             -s

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to