From: Douglas Livingstone Date: 2005-06-26T11:58:34+09:00 Subject: Re: I saw the beauty of Ruby Re: 1. Ruby result: 101 seconds , 2. Java result:9.8 seconds, 3. Perl result:62 seconds I think this shows the speed of my computer more than anything else: C:\dev>ruby primes.rb 5133 time taken: 2.06 seconds 5133 time taken: 41.82 seconds Florian again 5133 time taken: 41.86 seconds Appending this: puts 'Florian again' # Florian's version b = Time.now.to_f puts Prime.new.inject(0) { |s, x| if x > 50000 then break s else s + 1 end } printf "time taken: %.2f seconds\n", Time.now.to_f-b To test this: > >Yeah, but that way's pretty slow. > > > It get's faster the second time you do it. Douglas On 6/26/05, Florian Frank wrote: > Joe Van Dyk wrote: > [...] > > And my output of your program is: > > 5133 > time taken: 0.86 seconds > 5133 > time taken: 0.44 seconds > > What's wrong with your computer? > > -- > Florian Frank > > >