Not so sure about the actual altitude measurement, but judging by how wildly ascent and descent varies from day to day on the exact same route, I'd say it's not all that accurate.
I have a 31 mile loop that I do often, and I've seen ascent total around 1200, and I've seen it around 2500, and everything in between. Same route, just a different day.
The GPS however, is scary accurate as you might expect. I hit the 31.0 mark at the exact same stoplight, every single time. I don't even use the cadence/speed sensors on one of my bikes because I trust the overall speed that much.