how to calculate upload speed as well as download speed separately.
How to determine the speed on internet programmatically?
like this
how to calculate upload speed as well as download speed separately.
How to determine the speed on internet programmatically?
like this
First capture start time of download or upload task, I mean when you start download or upload capture or store your current system time something like,
NSTimeInterval startTime = [NSDate timeIntervalSinceReferenceDate];
Then you can check your download or upload speed
like,
double yourSpeed = bytesTransferred / ([NSDate timeIntervalSinceReferenceDate] - startTime);
bytesTransferred
, you can got from delegate methods
of your NSURlSession
or NSUrlConnection
whatever you are using!!!