/ Published in: JavaScript
Expand |
Embed | Plain Text
if (typeof console == "undefined"){ // var debugBox = $('<div id="debugBox"><h2>Version 1.06</h2></div>').css({position:'absolute', top:'0', right:'0', background:'#ddd', color:'#000', border:'1px solid #ff0000', padding:'10px', 'z-index':'9999'}).appendTo('#wrapper_outer'); var IEConsole = function(){ this.startTime = null; this.timerName = null; }; IEConsole.prototype.time = function(name){ this.startTime = new Date().getTime(); this.timerName = name ? name : 'Default'; } IEConsole.prototype.timeEnd = function(name){ var end = new Date().getTime(), string = (this.timerName+' '+(end-this.startTime)+'ms'); //debugBox.append('<p>'+string+'</p>') this.startTime = null; this.timerName = null; } IEConsole.prototype.log = function(value){ //debugBox.append('<p><strong>'+value+'</strong></p>') } var console = new IEConsole(); }; console.time('name') console.timeEnd('name')
You need to login to post a comment.
