Work asynchronously by using setTimeout

This change improves the app so that it can handle multiple requests in the same thread by replacing the `sleep`/`usleep` calls with `setTimeout`.

This has the downside of limiting the granularity of the time value to milliseconds, making 1ms the minimum time (compared to a theoretical 1µs before). This also means that the `-n` command line parameter didn't make sense, so I removed it.