At the very start of your script, use console.time('Some_Name_Here');
, and then use console.timeEnd('Some_Name_Here');
wherever the script finishes its execution.
It's a quick, native functionality of Node.js, and prevents you from having to initialize a new Date object.
Here's some short documentation on the console.time()
method: http://nodejs.org/api/stdio.html#stdio_console_time_label.