I use the "Map my ride" app and the built in gps on my iphone, open the app and click start, couldn't be easier. It keeps track of distance, speed, elevation, time and more. If you're stopping somewhere along the ride you can pause it and then resume when you get going again. Website affiliated with it allows you to share your routes with the popular social networks, creates a url for your ride to share the actual map of the route. I keep the phone in a ziploc bag in my seat pack.
http://www.mapmyride.com/
GL and ride safe