add a measuring latency logic