🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Calculating ping

Started by
2 comments, last by MadProgrammer 22 years, 7 months ago
this is my idea for calculating ping, tell me if im right, close, or dead wrong. Every so often (or imbedded in every other packe) the client sends a "ping" packet to the server that includes the clients Tick count when the client sent it. the server then immediately sends that packet back to the client, not changing the tick count. the client then subtracts the tick count in the packet from the current tick count, divides by 2, and wala! (i think) is that how its done?
Advertisement
really close, but don''t divide it by 2 because ping is the time measured between the packet''s ''start''(when you send it) and it''s ''end'' (when you got it back).
thanks
In case you''re interested, Microsoft have an ICMP library (the protocol used for ping) which is freely available.

Do a search on Microsoft for ICMP API
"Absorb what is useful, reject what is useless, and add what is specifically your own." - Lee Jun Fan

This topic is closed to new replies.

Advertisement