Re: [racket] Extract values from `time` function

2012-02-06 Thread Sergi Mansilla
Thanks a lot, makes sense now. Jens: Good tip about garbage-collecting before doing the benchmark! On Sun, Feb 5, 2012 at 6:27 PM, Jens Axel Søgaard wrote: > Tip: To get reliable results, garbage collect before the timing. > > /Jens Axel > > > 2012/2/5 Sergi Mansilla >> >> Hi, >> >> For benchma

Re: [racket] Extract values from `time` function

2012-02-05 Thread Sam Tobin-Hochstadt
You want to use the `time-apply' function. The documentation is here: http://docs.racket-lang.org/reference/time.html?q=time-apply#%28def._%28%28quote._~23~25kernel%29._time-apply%29%29 In general, (time e) can be converted to (time-apply (lambda () e) '()), which produces values instead of print

Re: [racket] Extract values from `time` function

2012-02-05 Thread Asumu Takikawa
On 2012-02-05 16:27:17 +0100, Sergi Mansilla wrote: > I'd like to do that with the `time` function, but I can't figure out > how to extract the values it prints, since it doesn't seem to be a > return value. I am clearly missing something obvious. How can I use > values returned by `time`? `time`

[racket] Extract values from `time` function

2012-02-05 Thread Sergi Mansilla
Hi, For benchmarking purposes, I am running a function hundreds of times and want to make an average of the time it spends running. For that purpose I am now using `current-inexact-milliseconds` before and after he loop, and then subtracting both times and dividing by the iterations performed. I'