react-native-ping
react-native-ping copied to clipboard
receivedNetworkSpeed and sendNetworkSpeed are always 0 b/s
const myFn = async () => { let test = await Ping.getTrafficStats(); console.warn(test); }
So, I am doing like that, and speeds are always 0. For example:
{"receivedNetworkSpeed": "0B/s", "receivedNetworkTotal": "153.4MB", "sendNetworkSpeed": "0B/s", "sendNetworkTotal": "22.2MB"}
It seems you are trying in simulator ?
{"receivedNetworkSpeed": "1.0KB/s", "receivedNetworkTotal": "631.9MB", "sendNetworkSpeed": "4.0KB/s", "sendNetworkTotal": "179.3MB"}
Ok. But it is not real speed. What can i do wrong?
const myFn = async () => { let test = await Ping.getTrafficStats(); console.warn(test); }
So, I am doing like that, and speeds are always 0. For example:
{"receivedNetworkSpeed": "0B/s", "receivedNetworkTotal": "153.4MB", "sendNetworkSpeed": "0B/s", "sendNetworkTotal": "22.2MB"}
Maybe you haven't done any network operations?
So, I need to download something, and than check speed?
So, I need to download something, and than check speed?
yes
Okay. And what I need to do, to check upload speed?
And I have a question. I need to download something big, and in this time immediately call getTrfficStats? What is the best approach?