The best way for you to know the latency between the server and the client is to use Javascript in the client page. Because when you generate you C# code it doesn’t know anything about the client.
Use this solution : Is it possible to ping a server from Javascript?
solved How to calculate latency between server and client using c#.net? [closed]