How to get the Execution time of function

I used the below statements, but failed with error. Anyone knows other ways? Thanks.
console.time()
console.timeEnd()

ERROR 04:12:25.297 9a62a796ba90bf73 console.time is not a function
TypeError: console.time is not a function
at fetchSprintData (webpack-internal:///7786:156:11)
at Object.App [as type] (webpack-internal:///7786:224:91)
at eval (webpack-internal:///2375:77:36)
at async asyncMap (webpack-internal:///2375:12:24)
at async eval (webpack-internal:///2375:33:29)
at async eval (webpack-internal:///4668:26:31)