Is phoenix channel can be use to microsecond stopwatch?

Hi guys here the thing i want to make scoring board with web that can see real time by everyone, but in my scoring board i do have stopwatch with microsecond precision

is it possible to use channel on this approach ? and how do i benchmark the latency


Even if you could accurately measure the latency from a server to a user to microsecond precision, it’s going to vary from one message to another (jitter) by many microseconds.

Can you describe what you’re trying to measure in more detail?

hmm actually im not trying to sending much information with websocket just signaling when to start and stop the stopwatch, my worry is if latency more that 500ms it will seen as glicth in my application

There’s a very big difference between 500ms and a microsecond :slight_smile:

The problems you’re looking for answers to transcend language and framework. The simple answer to your question is yes, you could definitely use a channel, but I suspect that the answer to your real question, as @al2o3cr implies, may require much more information.

Certainly you can have your Elixir server generate a timestamp at microsecond accuracy.

Can you walk us through how a user or users would interact with your application in a step by step way?

yeah so i make some POC on my project years ago, when i click to stop button to pause the watch it take like 1sec before stopwatch pause, i see there some issue with slow connection where i do test

Do you have a an example that demonstrates this issue? Phoenix channels add mere microseconds of latency on top of the actual connection latency, it should be extremely fast.