Created
September 8, 2010 19:48
-
-
Save kentaromiura/570711 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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