Calculate latency of socket events and send a post to an endpoint