How to find out the system time when a message is received from a socket?

Hi, I am trying to conduct an experiment that determines message-propagation delays, processor speed differences, and clock synchronization errors between 2 computers. I am running the experiment using both TCP/IP and UDP connections. I just wondered, if I could get the system time when a message is received,  I could possibly calculate the message progapation delay. However, I am not clear how to get the time stamp whenever a message is received. Could someone help me with this?
Who is Participating?
Well when you detect the message by listening to the socket just get the system time if a message is recieved. I'm assuming here that you are detecting when a message is recieved. I believe that to get the system time it's something like

DateTime CurrTime = DateTime.Now;
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.