title: Attempt at decorators with multiple order python function
body: <p>I am currently working with multiple order functions in python and as an exercise wanted to try working with a function decorator. In this example, I have a simple counter and wish to use datetime to approximate the amount of time it takes for the computer to count to a certain value given the code:</p>
  
  <pre><code>from datetime import datetime
  
  def elapsedTime(f):
      time1=datetime.now()
      def runFunc():
          return f()
      time2=datetime.now()
      return time2-time1
  
  @elapsedTime
  def count(n):
      out=0
      for i in range(n):
          out += 1
      return out
  
  out, deltaT= count(50000)
  print("count(50000) returns:", out)
  print("elapsed time (sec): ", deltaT.total_seconds())
  print("type of deltaT: ", type(deltaT))
  </code></pre>
  
  <p>Where the output I am expecting is:</p>
  
  <pre><code>count(50000) returns: 50000
  elapsed time (sec): (calculated value)
  type of deltaT:  &lt;class 'datetime.timedelta'&gt;
  </code></pre>
  
  <p>However, whenever I attempt to run this code I receive an error at line 17 (where I call count(50000)) stating:</p>
  
  <pre><code>TypeError: 'datetime.timedelta' object is not callable
  </code></pre>
  
  <p>I'm a little lost on this one and was hoping someone could point out where the error is occurring.</p>