From: Maarten Boonen Date: 2005-01-22T07:45:58+09:00 Subject: Re: disabling method caching Simon Strandgaard schreef: > 5 times is not enough to tell how much time that average is spend in > the code.. it usually takes time to do setup/teardown, it can be > affected by the operating systems scheduler. > > The average running time usually becomes visible by running it many times.. > over and over.. try with 1000 times.. so that the program spends some seconds > in the code. well, the total testing already takes half an hour, so doing it 1000 times isn't really an option. But I'm pretty sure that's not the problem. Some example code might clarify: if I do [250].each do |sg| 5.times do start = Time.now algorithm(sg) puts Time.now - start end end the times are (in seconds): 8.853 8.602 7.33 7.281 7.32 but if I do [1,250].each do |sg| 5.times do start = Time.now algorithm(sg) puts Time.now - start end end the times are (for the 250 case): 2.804 4.336 3.835 4.036 3.765 > I don't think such thing exists. sorry. Thanks anyway, Maarten