take latency into account