title: TestFirst Performance Monitor Ruby
body: <p>Im a newb trying to work some problems in this tutorial: <a href="http://testfirst.org/live/learn_ruby/performance_monitor" rel="nofollow">http://testfirst.org/live/learn_ruby/performance_monitor</a></p>
  
  <p>My current code passes 5 of 7, failing the last two. I think the problem is that I really don't get what its asking for:</p>
  
  <pre><code>it "returns the average time, not the total time, when running multiple times" do
    run_times = [8,6,5,7]
    fake_time = @eleven_am
    Time.stub(:now) { fake_time }
    average_time = measure(4) do
      fake_time += run_times.pop
    end
    average_time.should == 6.5
  end
  </code></pre>
  
  <p>Here is what I currently have:</p>
  
  <pre><code>def measure(x=0)
  
    if x&gt;0
      x.times do yield end
    else
      y= Time.now
      yield 
      elapsed_time=Time.now-y
      elapsed_time
    end
  end
  </code></pre>
  
  <p>I'm not looking for a copy and paste answer. I am want to have clarity in what its asking for, and how I may tackle the challenge. Thanks.</p>