 class TimeReporter  extends jasmine.Reporter
 
   timedSpecs: []
+  timedSuites: {}
 
   constructor: ->
     window.logLongestSpec = -> window.logLongestSpecs(1)

        console.log "#{spec.time}ms"
        console.log spec.description

  reportSpecStarting: (spec) ->
    stack = [spec.description]
    suite = spec.suite
    while suite
      stack.unshift suite.description
      suite = suite.parentSuite

    @time = new Date().getTime()


  reportSpecResults: ->
    return unless @time? and @description?

    duration = new Date().getTime() - @time
    @timedSpecs.push
      description: @description
      time: duration
    if @timedSuites[@suite]
      @timedSuites[@suite] += duration
    else
      @timedSuites[@suite] = duration
    @time = null
    @description = null
