From an election timing POV; if you're going to resign, now is a reasonable choice. 
\~1 month to shuffle the chairs, \~6 months to re-establish the new PM and cabinet in the media and public mind, then into the election campaign.