Похожие чаты

What would be the best way to get an accurate

fetch response time?

I've tried timing it myself however my time often disagrees with the browser timing, and there's often a noticeable discrepancy between timings on Chrome vs Firefox (from 5-1000ms)
Is there anyway to get the timing from the browser, or achieve better accuracy timing it myself?

Here's my attempt

11 ответов

11 просмотров

you can't. processing of JS and browser APIs is determined by the underlying CPU interrupts.

VantaRabbit
Damn 😔

but why does getting accurate figure matter?

instead of Date.now, use performance.now. Though yes they wont be same as there are a lot of variables (cpu frequency, load, pending interrupts, network latency, event loop, etc) in play

VantaRabbit- Автор вопроса
A​kshit
instead of Date.now, use performance.now. Though y...

performance.now() was actually what I tried first, and saw similar behaviour, so I've continued using Date.now(). Perhaps I'll have to revisit it.

VantaRabbit
performance.now() was actually what I tried first,...

yeah then its your network latency being unpredictable

VantaRabbit- Автор вопроса
A​kshit
yeah then its your network latency being unpredict...

That can't be it. The browser timing is stable, and consistent with command line pings.

VantaRabbit- Автор вопроса
VantaRabbit
That can't be it. The browser timing is stable, an...

I should clarify, by "browser timing" I'm talking about the the timings displayed in the Networking tab of the developer tools.

VantaRabbit
That can't be it. The browser timing is stable, an...

oh also javascript timers are made to be a bit inaccurate

VantaRabbit- Автор вопроса
A​kshit
oh also javascript timers are made to be a bit ina...

Yeah, that's what's got me scratching my head. I read about that in MDN. I just realized that I've had cached disabled, with it enabled I'm still seeing wildly inaccurate timing but in the other direction. I know my ping should be between 50-70ms but with cache enabled, I'm seeing 5-6ms with it disabled I'm seeing 100+

VantaRabbit- Автор вопроса

the answer here was use web sockets. So far, waaay better accuracy.

Похожие вопросы

Обсуждают сегодня

This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
есть ПО, которое лежит папкой, по сути и не инсталится, а просто запускается. Надо раскидать по машинам в домене. Я так понял, что прям настройками GPO, копировать я смогу тол...
Dmitriy
8
any reference of this implementation?
BitBuddha
29
Чёт не понял, я ж правильной функцией воспользовался чтобы вывести отладочную информацию? но что-то она не ловится
notme
18
Привет)) уже кажется эту тему перемусолили, но вот я так и не понял. Я сейчас сижу на 27дюймов 2к мониторе. На Актуальной макоси, если я куплю 27д 4к монитор: - будет ли изобр...
Vladislav Piskunov
16
Добрый день! Скажите пожалуйста, а какие программы вы бы рекомендовали написать для того, чтобы научиться управлять памятью? Можно написать динамический массив, можно связный ...
Филипп
7
Also, why can’t the community have a vote/ say when it comes to initiatives like buybacks. Isn’t the point of crypto decentralisation? Don’t we deserve input as long term supp...
👨🏽‍🦰
13
Карта сайта