Measuring the distance between one revolution of thread would be a rookie move and definitely prone to the error you speek of. Measure the span of a (known) number of threads and math it. I do this frequently. All things considered here OP just needs to take the fastener to someone and not buy titanium.Sometimes. But not always accurately enough. It's just eyeballing. You can do that with a tape measure too.
An M5x0.8 is 31.75 threads per inch.
And #10-32 is 32 threads per inch.
You can't discern the two with a caliper. Their pitch is near identical.