In this post I’ll present a reusable function for timing async operations in JavaScript. calc is an async function that we like to profile. By convention its last argument is a callback. We use calc like this: calc(arg, (err, res) => console.log(err || res)) Perhaps the easiest way of profiling…