var log = function(msg){ if(window.console){ var now = new Date - 0; var last = arguments.callee.last; if(typeof last === "number"){ window.console.log(msg +" : "+(now-last)+" ms"); } arguments.callee.last = now; } }