I want to log the execution times of all my Javascript functions into a HTML5 local database (or use ajax to post the restults to the server), so I can find out which functions are the most time consuming and need to be tweaked.
I figured I should have some kind of 'base'-function that does this logging, on which I base all my other functions.
I know a little bit about prototype classes in Javascript, but obviously not enough. Are functions also some kind of objects that can be extended ?
Is it even possible to create this kind of base-function which starts a timer at the beginning of the function, and then after the extended function is finished then logs the execution time?