我如何计算往返时间(RTT)? [英] How I calculate round trip time (RTT)?

查看:2715
本文介绍了我如何计算往返时间(RTT)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

客户端将向服务器发送简单的ping消息,从服务器接收相应的pong消息,并确定客户端发送ping消息和收到pong消息之间的延迟。这种延迟称为往返时间(RTT)..如何计算RTT?



我尝试过的方法:



计划3:UDP Pinger:2011 [ ^ ]

client will send a simple ping message to a server, receive a corresponding pong message back from the server, and determine the delay between when the client sent the ping message and received the pong message. This delay is called the Round Trip Time (RTT)..How I can calc RTT ?

What I have tried:

Program 3: UDP Pinger: 2011[^]

推荐答案

1)开始计时器,或使用 Java.lang.System.nanoTime() [ ^ ]

2)发送Ping。

3)当你收到Pong时,停止计时器,或再次使用nanoTime来获得新的时间。



经过的时间(或nanoTime值之间的差异) )是RTT。
1) Start a timer, or use Java.lang.System.nanoTime()[^]
2) Send the Ping.
3) When you receive the Pong, stop the timer, or use nanoTime again to get the new time.

The elapsed time (or the difference between the nanoTime values) is the RTT.


这篇关于我如何计算往返时间(RTT)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆