From: Wybo Dekker Date: 2005-07-16T01:10:00+09:00 Subject: Re: [QUIZ] Sampling (#39) On Fri, 15 Jul 2005, James Edward Gray II wrote: > On Jul 15, 2005, at 8:00 AM, Ruby Quiz wrote: > > > Now for all the algorithm junkies out there that enjoy a little friendly > > competition, here's the time to beat: > > > > $ time ./sample 5_000_000 1_000_000_000 > big_sample.txt > > > > real 30m10.593s > > user 29m54.544s > > sys 0m4.736s > $ time ruby -e '5_000_000.times do puts rand(1_000_000_000) end' >big_sample.txt elap 16.612 user 16.421 syst 0.177 CPU 99.91% $ wc big_sample.txt 5000000 5000000 49446636 big_sample.txt or do I miss something?? -- Wybo