Improve readability of 'timeout calculation fromn latency' function