It was years in my case but should arguably have been less. (It wasn't a crap job by any means but didn't pay well by many tech standards at that point.)
It's always been through personal contacts but I've surely been lucky.
I held on to the crap job for 1 year 11 months. In 2004 I quit and found a Wall Street gig that was much better.