嗨,我必须开发一个应用程序,它将有助于找到wifi速度 . 基于wifi速度我必须改变wifi路由器的位置 . 这个应用程序的主要目的是决定房间里的wifi路由器位置 . 但我不知道如何找到wifi信号的速度 . 请帮我完成这个应用程序 . 请让我知道如何找到无线互联网连接的速度 . 提前致谢 .
一种方法是通过反复ping远程服务器并查看响应时间是否发生变化 . 坦率地说,我认为差异可能非常微小,但无论哪种方式,你都可以使用AFNetworking来做到这一点 .
startTime = CACurrentMediaTime(); //This will start the clock. AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; [manager GET:@"http://example.com/resources.json" parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) { double elapsedTime = (CACurrentMediaTime() - startTime); //in case of success you calculate the elapsed time } failure:^(AFHTTPRequestOperation *operation, NSError *error) { NSLog(@"Error: %@", error); }];
I am adding this great tutorial on how to use AFNetworking.
1 回答
一种方法是通过反复ping远程服务器并查看响应时间是否发生变化 . 坦率地说,我认为差异可能非常微小,但无论哪种方式,你都可以使用AFNetworking来做到这一点 .
I am adding this great tutorial on how to use AFNetworking.