In the course of my development, I've sometimes found it necessary to simulate delay or latency as I'm often requesting resources that are on my local development machine and I get response times that don't reflect the real world.  To help create this simulated latency, I whipped together a simple little delay function that inserts random wait periods to better reflect what might happen in a production, publicly served web app.

Leave a Reply.