That doesn't frighten you, David?
Mostly I don't worry too much about it, I start the new yarn when the old runs out. I'm sure other people know more and can estimate better than I do. When I did worry about it, I would tie a slip knot in my yarn at about a yard from the needle, use a stitch marker to mark my starting stitch and then count how many stitches I had done when I got to the slip knot. From there I could estimate fairly closely how many yards it took for a row. You can use whatever unit of measure you're comfortable with, I hold the needle near my nose and stretch my arm out to measure a yard. If I'm doing a stitch pattern I don't want to risk running out of yarn, this is how I'll do it.