I am trying to figure out how to get the latency between when a post is posted and when it's received to simulate realtime by guessing what next post will say.
The closest I've gotten so far is adding the current date in milliseconds (new Date().getTime()) in the post and comparing the value with the receiver's date. This works good but of course only works when I'm testing on my own computer since other computers will have different date. But that shows what I'm trying to accomplish.
I'm not sure if there's a good way to check this. I'm trying to think of a way to check it but so far the above is the closest I've gotten.
I'm just throwing this out there to see if someone has any idea or if someone has a similar problem.
You can have the reciever automatically send the object/message back so that you can compute the time it takes for the object/message to hit the reciever and et back to you and divide that by 2!