start_time = time.time()
print time.time() - start_time, "seconds"

reading up

on this page there is a nice description of the single threaded nature of javascript:

this snippet displays the latency on your browser for executing the next cycle:

var i = 0, diff = 0, d = new Date()

var timer = setTimeout(function() {
diff += new Date() - d
timer = setTimeout(arguments.callee, 0)
if (i++==1000) {
alert("Resolution: "+diff/i)
d = new Date()
}, 0)

The key to the above, and many timing issues in javascript is:
setTimeout(function_call, 0)

also some considerations for making sure that changes to the DOM are re-rendered before continuing to the next display update.,or.r_gc.r_pw.r_qf.&bvm=bv.41018144,d.aWc&biw=987&bih=887