How get current internet speed in kbps or Mbps for ionic 4 angular 6 project

Hey guys ,

I’m developing a ionic 4 angular 6 web app (cards game).
i want to stop user action detecting slower internet i.e based on real time internet speed,

I have tried several ionic packages, but they detect only type of network.(ex 2g, 3g, 4g etc)
But i want the code which give real time internet speed like how how other apps detect slower internet.

If anybody cracked it out, will be be much useful.

Thank you

“Internet speed” isn’t really a meaningful phrase outside of marketing materials.

If your app is periodically phoning home to a specific game server or cluster you control, the bandwidth capability and lag of the connection between each client and that server is likely really what you care about, and you have the means to measure it yourself. Introduce a health check endpoint to your API and measure how long it takes to hear back from it. Now and again download known amounts of data and report back how long it took to arrive.