Suppose I have called a function as,
const data = await someFunction()
I want to calculate execution time of this function.
For this I tried as,
let startTime = Date.now();
const data = await someFunction()
let endTime = Date.now();
And I calculated difference between endTime-startTime and the result I get i think is in millisecond and converted it to second.
I would like second opinion on this whether this is one of the option to calculate or is there some more better method which can give me execution time in second.