Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Simple profiler

View profiler.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
var profiler = {
layer: $('<div id="profiler" style="position: fixed; left: 0; bottom: 0; width: 200px; z-index: 25000;"></div>'),
cache: {},
init: function(){
this.__inited = true;
$('body').mousemove(function(e) {
if(e.pageX < 200)
{
profiler.layer.css({
left: e.pageX - 200
});
}
});
this.layer.appendTo('body');
},
time: function(id){
this.cache[id] = new Date();
},
timeEnd: function(id){
if(this.__inited) $('<p>' + id + ': <b>' + ((new Date()) - this.cache[id]) + '</b></p>').appendTo(this.layer);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.