Distance most times but at times I also measure my rides by elevation gain. I may do longer rides aiming for a distance goal on weekends. Midweek rides I ride with elevation in mind pressed for time. I start riding up the local hills then when I hit 1,000 ft, I turn around, Usually giving me a quick 11 miler on weekdays.
At times depending on my goals, I may aim for 5,000 to 7,000 ft of climbing preparing for an organized event. If I get it in 40 to 60 miles I'm happy not being so concerned with distance at the time.