1

I am currently working on a project which have a part to test my connection speed and retrieve the results.

The results should contains the following:

Downlink Data Throughput(Mbps)
Maximum Downlink Data Rate(Mbps)
Avg Downlink Data Rate(Mbps)
Session Duration(mSec)
Latency / Ping Test(mSec)

I have found the speedTest which I can basically use it to get the Max and Avg Data Rate and session duration(the time to download the file)

But how am I supposed to get the Downlink Data throughput and Ping ? Can anyone help me how to retrieve those data?

Community
  • 1
  • 1
Iphone User
  • 1,930
  • 2
  • 17
  • 26
  • You have to do it yourself. Create a connection, download some stuff and measure whatever you want. There's nothing out there that's going to do it for you. – Avi Jan 19 '16 at 11:21
  • @Avi i know i should do it by myself, but i am asking how to retrieve the downlink data throughput and ping? what should be the method to accomplish it? the definition of these 2 made it unclear for me to know how to retrieve it. – Iphone User Jan 19 '16 at 12:21

1 Answers1

1

In order to check ping latency,

@property (strong,nonatomic) NSDate *start;

- (void)simplePing:(SimplePing *)pinger didSendPacket:(NSData *)packet
{
    self.start=[NSDate date];
}

- (void)simplePing:(SimplePing *)pinger didReceivePingResponsePacket:(NSData *)packet
{
    NSDate *end=[NSDate date];
    double latency = [end timeIntervalSinceDate:self.start]*1000.0;

    //TODO - Do something with latency
}

Edit on 7-April-2017

You may also want to see this github project: https://github.com/lmirosevic/GBPing

Vikas Bansal
  • 10,662
  • 14
  • 58
  • 100