measure execution time of functions and promises