Im using express with node.js, and testing certain routes. I\'m doing this tute at http://coenraets.org/blog/2012/10/creating-a-rest-api-using-node-js-express-and-mongodb/
app.get('/fakeDelay', function(req,res){ let ms = req.query.t; ms = (ms>5000 || isNaN(ms)) ? 1000 : parseInt(ms); setTimeout((()=> res.status(200).send({delay:ms})), ms); })
Then request the URL as: http://localhost/fakeDelay/?t=2000
(max 5000ms and default of 1000ms on this example)