Perhaps you could measure the time of the login process and adjust the random delay based on how long the process has taken. If you can get this to average to a <1ms difference between the "email exists" and "email doesn't exist" you could probably defeat any timing attacks over the network.
That, or just limit retries and have different random timeouts for every login. Now you can't try enough times to get a good estimate of the mean for each login path, and you can't use other logins to help you refine your estimate because each has different timeouts.
I mostly don't bother anymore, because an effective timing attack for account discovery against something that's doing everything else correctly should take so many attempts that it should wake up whatever brute force protection sites should be running now anyway.
Given the number of dumb automated brute force probes against just about anything with a login, you can't just allow an infinite number of requests from a single IP (or a handful of IPs).
It’s the idea that knowing that an account exists somehow represents a compromise in the accounts security posture that I generally reject.
The random sleep is to prevent obtaining enough samples and provide reasonable noise at this small sample size. Given enough samples until the end of time, patterns can be obtained. This is not breaking TLS here, this is login, and seconds of sleep vs microseconds makes a difference.
Granted, this doesn't apply to eg banks, but there's plenty of websites where this could apply.
As to preventing timing attacks you can add a delay to give a uniform response time.
You have to be very careful with how you implement the delay to prevent the timing signal from still propagating to the attacker.
https://blog.ircmaxell.com/2014/11/its-all-about-time.html#A...