A function that waits for the specified amount of milliseconds. Uses kotlinx.coroutines.delay by default. Useful for tests.