Skip to content

Instantly share code, notes, and snippets.

@kentaromiura
Created September 8, 2010 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kentaromiura/570711 to your computer and use it in GitHub Desktop.
Save kentaromiura/570711 to your computer and use it in GitHub Desktop.
Class.Mutators.Profile = function(uniqueID){
var imp = this.implement;
this.implement = function(key, value){
if($type(key) =='string' && $type(value) == 'function'){
var me = this;
var profile = function(){
var start = $time();
var res = value.apply(me,arguments);
//console.log([uniqueID, $time() -start, key].join(' '));
alert([uniqueID, $time() -start, key].join(' '));
return res;
}
return imp.apply(this, [key,profile]);
}
return imp.call(this, arguments);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment