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

Posted on 2006-04-09
Last Modified: 2010-04-16
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?
Question by:maggiesheu
    1 Comment
    LVL 7

    Accepted Solution

    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;

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Live - One-on-One C# Help from Top Experts

    Solve your toughest problems, fast.
    C# experts are online now and ready to help you.

    This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
    Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now