                           "#{escapeHTML(l)}<br>" for l in labels[...3]).join ""
             else
                 label = escapeHTML(frame.label)
-            label += "<br>spanning #{frame.duration}ms"
+            label += "<br>spanning #{smartTime frame.duration / 1e3}"
 
             elems.tooltip.children(".tooltip-inner").html label
             elems.tooltip.show().offset(

# Format a number of seconds into appropriate time units. e.g. smartTime(3600) === '1h'
smartTime = _smartUnits(
    [31556952, 604800, 86400, 3600, 60, 1, 1e-3, 1e-6, 1e-9, 1e-12]
    ['y', 'w', 'd', 'h', 'm', 's', 'ms', 'μs', 'ns', 'ps', '']
    [2, 2, 2, 2, 2, 2, 3])

# Format a fraction number into a percentage. e.g. smartPercent(0.1) === '10.0%'
smartPercent = (v) -> ((v * 100).toPrecision(3) + "%")

        ctx.moveTo left, top
        ctx.lineTo left, HEIGHT

        ctx.fillStyle = "#888"
        ctx.fillText label, left + MARKER_SPACING, top
        metrics = ctx.measureText label
