How long do you wait?

If you have legitimate grounds for divorce. How long do you wait and pray and work on the relationship before coming to terms that your spouse will never change, and walk away... 💔