I have a basic cycling computer on the bike for instantaneous speed. It has other functions, but that's pretty much all I use it for.
For logging routes and keep better track of things, I use MapMyRide with my iPhone4s. I'm only using it as a datalogger, so the screen is off. I don't know how long it will last with a full charge that way, but when I go on long rides, I hook it up to a small solar power cell (about the same size as the phone) that has another 1400mAh battery. Never had it run out of battery with that, and the longest I've gone with that was about 5 hours (hiking).