Lambda function to artificially induce delay

Code Thoughts
Jul 5, 2018

You might ask “Why in the world would you want to artificially delay your function execution, when I have been trying hard to optimize its performance?!!”.

Well, the real world does not always work the way you want and the more prepared you are, the better it is for everybody. I wanted a function that could simulate lambda functions executing for too long, so as to be able to handle the timeout errors on the application I was developing.

I had to go through a few iterations to figure out how to make it happen. So, saving it here for future coders :)

--

--