How long should a successful rebuild take?

I would start off by if you are wanting a true rebuild, then it's going to be tough for a couple years. First is to get salary cap in order. Let what you can go that is high priced and doesn't produce. Can't let them all go but specific ones that we can. Draft very well to get talent and lower pay. And if you reset your cap and draft well I would say within 3 years you should be real competitive and by year 4 making a good run.
Now this is if you do a true rebuild and not bring in a high priced QB and others.
As in Spencer rattler turning out to be a good qb on a rookie deal like the 49ers with Purdy ?