If only we knew then what we know now, it would all be a lot easier huh... thing is, i think we are meant to learn from experience.
Mariage is HARD work, but both have to be willing to work on it (it takes 2 to tango) .... don't live a miserable life and stay for the kids sake, your kids are clever, they pick things up and they know more then we think.
Do what YOU feel you have to do, the only thing i want to add is, don't leave your hubby for another man, it could backfire on you and you honestly DON'T want that to happen.
Good luck, we are here for you.