Похожие чаты

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 ответов

14 просмотров

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.

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

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

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
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
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта