The issues is with the user code (int)_uiSpawnTime * 1000 results in a wait time of 0.
`await Task.Delay(0)` will be executed synchronously and control of the main thread will never be release. `Math.Max((int) (_uiSpawnTime * 1000), 1)` should solve the issue.