Collection of interesting and useful JS functions.
For usage see the tests
Wraps the specified function in an arrow function that times the promise and appends fulfillment / rejection handler that returns the return value as "ret" and the elapsed time as "elapsedTime".
fn
Function that is exptected to return a Promise.
const wrappedFn = timeFnPromise(aFunctionThatReturnsAPromise)
wrappedFn()
.then((values)=>{
const {ret, elapsedTime} = values
console.log(`ret:[${ret}] elapsedTime:[${elapsedTime}]`)
})