Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

226
Vistas
is this a valid way to get the latency from websocket connection?

I am trying to measure the latency when data are sent to the client from the server. My approach is calculating the difference between the server side and client side timestamp. Would this be a valid approach?

server.js

const timestamp = new Date().getTime()
io.emit('get_data', data, timestamp)

client.js

  const [latency, setLatency] = useState(0)
  (...)
  useEffect(() => {
    socket.on('get_data', (res, sentTime) => {
      const currentTime = new Date().getTime()
      const latency = currentTime - sentTime
    },[socket])
about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

I think this is not a good approach to measuring performance. This is a manual approach and you will not get the best estimation. Generally, we calculate performance based on statistics. The more sample you add to your test, you will get the better the estimation. I think load-testing is a good technique to stress the server. JMeter is probably the best option to perform load-testing.

about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda