It took me about 10 minutes at the local city hall. However, my wife is Swiss, so I'm very much an exception.
If you don't have a familial connection, you need to find a job, and the company will need to prove they couldn't find a local Swiss resident/citizen that could have done the same job, so it's a bit harder to get in than Germany or other areas of the EU.
Edit: I'm on a multi-year residency visa. I'll need to renew once more before I'm eligible for citizenship (after ~5 years).