basically it returns NOW as in RIGHT NOW which you can capture in a var for later use. Here's a basic pattern for use:
var s = performance.now();
console.log(performance.now() - s);
this will log the time "do something" took to complete in ms.
performance is a property of the window object, therefore it is NOT available on nodejs. You can use the following in that environment:
2. console.time("key"); console.timeEnd("key");
use it like this:
depending on the js engine, you'll get an output like:
"key" 3.002 ms
If you want to measure more than just the execution time, like memory usage, i/o usage, and processor use these quick-and-dirty functions won't get you that. Look for a future post on those topics...