I'm not sure what you mean. All you need to do is this:
function computation() { ... }
before = performance.now();
computation();
t = performance.now() - before;
(Obviously there will be noise, and you need to average a bunch of runs to get reliable results.)