ESPP is only really done in huge companies, and the terms vary too widely to be added to a common calculator. When I had one, though, I could sell right away. And the purchase price had a few different ways of being calculated, and they applied whichever was lower, so sometimes my effective discount was 25% or more.
I just cranked that shit up to the max, and sold most of it right away. I kept a small portion from each purchase as a side investment, just in case they screwed me over. I considered it my own personal severance plan, built up essentially for free.