Yes, I did that. My DC were 4 and 1 when I discovered what a shit he was. I made a vow that I would stay, because I believed that children need both parents ( and because he was a good dad despite being a bad husband). I stayed until they were 21 and 17 .
I've never regretted my decision . When I did leave I was fully prepared, and had made my plans so everything went really smoothly. My kids understood why I was going, and we were able to speak about it in an adult manner . Nobody had their life fractured or damaged and I was happy with the whole situation.
I was glad that I didn't leave earlier - my circumstances were not conducive to an easy split . Ex had a job which took him away a lot, and the DC would hardly have seen him if we'd split when they were young . By the time I did leave, things were more manageable and everyone could see each other when they liked.
It has been 17 years now, and both ex and I are remarried and grandparents. I really wouldn't change anything about the way I did it.
In your case, a lot would depend on why you want to make this plan. If your husband is really horrible, I wouldn't recommend staying for another 10 or 15 years. It could be a very miserable and long time for everyone. But if he is just unpleasant and selfish , if he is a good dad, it certainly can be a good thing to play the long game . Just knowing " in 10 / 15 years I'll be gone " can be something to keep in the back of your mind .
I know that a lot of people would say "go now" but do consider all of your options. The ball is your court now, and that in itself can be very comforting !
Best wishes with whatever you decide.