var origDoSomething = Thing.prototype.doSomething; Thing.prototype.doSomething = function() { var start = Date.now(); var result = origDoSomething.apply(this, arguments); console.log((Date.now() - start) + 'ms', x, y, result); return result; }