A friend of mine recently participated in a mountain bike race in Colorado. His 18-mile ride was completely tracked by the Strava Cycling - GPS Biking and Riding Route Tracker (free).
Your iPhone works as the GPS device. Go out for a ride and then view your activities on Strava.com.
As you can see on the image above, it took my friend less than 2 hours to complete the 18 mile race, climbing 1,500 feet in elevation (already starting at 6,900 feet!).
It also shows his times for each section of the race. So far this year, he has racked up 368 miles on his bike (the ones he used Strava for anyway).
The free version of Strava offers quite a bit. There are detailed maps and analysis of your activities. You can have virtual competitions with other bikers using Strava or just compete against your own achievements. You can also follow friendly rivals and discover new trails/segments in your area or while traveling. It even shows your distance, speed and more important to me, calories burned.
If you upgrade to a premium membership for $6 monthly or $59 annually, you can receive more info on your training as Strava analyzes your heart rate and compares segment efforts. You can set time or distance goals and track your progress week by week.
Also in the premium membership you are able to view a power analysis to test endurance and see exactly when and where you're at your freshest or most fatigued during your rides. And, see where you stack up against other riders in your age and weight class.
In addition, if your friends are using Strava, you can see if they are currently out riding.
You can even post your ride on Facebook and show off that ride of endurance to your friends who can cheer you on (or feel guilty because all they did was watch TV that day).
For more biking apps worth checking out, see iPhone Life's Arnold Zafra's blog here.
There is also a Strava app for runners.