I have a fold out gauge the works for most anything. Each blade has teeth on it and you match them up to the find which blade's teeth drop in the threads of bolt or screw. Then you need to measure the OD and use a chart. Think it goes from 80 to the inch to 4 to the inch.
But the best thing I have for small gun screws is a small hardened test plate that has thread sizes and pitches stamped on it. I bought it from one of the boxes in an ACE Hardware gun screw selection. Has 4-40, 4-48, 5-40, 6-32, 6-40, 6-48, 8-32, 8-36 and 8-40 which covers most small gun screws, The smaller stuff than that I just buy a screw and try it. I now have a 0-80, 1-72 and a couple different #2 machine screws in my "kit" all about 3/4" long that I try. Think the try plate was about $4
Another useful thing I use the test plate for. Ace sells lots of different gun screws. But, they are seldom the exact length I need. Holding on to them and grinding them sucks. But screw them in to the test plate with the head down tightt against the plate and you know have a solid way to hold the screw. With calibers you can measure without removing it from plate. Plus, when you remove it from the hardened plate it cleans of any little burrs on the tip.