Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Nic Huang](https://uploads.teamtreehouse.com/production/profile-photos/112216/micro_Nic.jpg)
Nic Huang
Courses Plus Student 10,573 PointsServer Ping with iPhone
In terminal, I PING www.google.com and I can receive the following data.
64 bytes from 74.125.203.104: icmp_seq=28 ttl=46 time=11.837 ms
But how can I achieve this in iOS, because I need the "time" data, so I can decide which domain is faster for me.
I've searched on the Internet and download Apple's sample code "SimplePing", but to no avail.
5 Answers
![Scott Evans](https://secure.gravatar.com/avatar/35227e03fe277c59bc3b0a7d8cf720c7?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Scott Evans
4,236 PointsHi Nic.
Just a quick question so i can tailor my answer to exactly what you need. Do you need to perform this PING synchronously or async?
Scott.
![Nic Huang](https://uploads.teamtreehouse.com/production/profile-photos/112216/micro_Nic.jpg)
Nic Huang
Courses Plus Student 10,573 PointsI think async is better for me. But Anyway, I only use that for deciding a faster domain.
Thank you in advance
![Scott Evans](https://secure.gravatar.com/avatar/35227e03fe277c59bc3b0a7d8cf720c7?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Scott Evans
4,236 PointsHi Nic.
Ive managed to get the SimplePing working from Apple, but I'm still a bit unsure how you want to implement this on iOS. Ill try to throw up an example for you if i can.
![Nic Huang](https://uploads.teamtreehouse.com/production/profile-photos/112216/micro_Nic.jpg)
Nic Huang
Courses Plus Student 10,573 PointsHi Scott
All I need is the time data ( time=11.837 ms ) for domain (ex. www.google.com). I've tried use SimplePing in my iOS project. But the delegate doesn't fire at all. And I thought the delegate method would give me what I want.
![Scott Evans](https://secure.gravatar.com/avatar/35227e03fe277c59bc3b0a7d8cf720c7?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Scott Evans
4,236 PointsIm not sure something like the ping is what you would need. Let me investigate a little and ill get back to you!