pubnub calculate publish latencies -
i'd calculate pubnub publish latencies pubnub clients before begin publishing. there preferred way to pubnub?
to make use case more clear, im trying synchronize clients, , these clients not need synchronized @ wall-clock time, since global. hence this solution, wouldnt necessary in case (but did point me in right direction)
so still obtain per-client latency calculation based on above link, that's fetching timestoken using time api. relevant above use-case depended on clients syncing particular wall-clock time, hence time-token anyways required fetched
however in case dont need timetoken. clients can synced using simple wait (k - latency) interval k constant clients .
therefore while can use timetoken method of calculating latency, prefer know actual publish latencies (unless there no vast difference between two)
here steps worked out myself determine latency publish
- determine local time (in milliseconds): start = now()
- client sends out message payload[ {"type" = "latencycheck"}, {"me" = "mypubnubuuid" }]
- when client receives message of above signature own id, sets variable end = now()
- latency send message , receive : end - start
Comments
Post a Comment