To be fair a four digit passcode is a little more secure than that. There are exactly 10,000 possible permutations, and iOS will lock you out for a period of time if you input the wrong code six times in a row.
Maybe a few minutes...not seconds. I saw an article about a software company that figured it out and was selling the software to law enforcement. I'm not sure if this is the company but it gives an idea of what's possible:
http://news.cnet.com/8301-1023_3-57405580-93/iphone-passcode-cracking-is-easier-than-you-think/