JE Custom covered the many way a barrel can be measured to figure bullet travel and ballistics.
To be Legal by Federal Law.
If you are measuring a barrel to check if it is legal by BATFE regulations.
When I was in the BATF class at the State Police Academy the instructor's demonstration was, Remove any removable Chokes or Flash Suppressors. Close the action, Insert Dowel Rod from muzzle to Breech Face, Mark Dowel Rod even with muzzle, Measure Dowel Rod from Breech Face End to muzzle mark on Dowel Rod Shotgun, 18 inch barrel, 26 inches overall. Rifle, Barrel Rifled and 16 inches in length, 26 inches overall
Years ago someone imported a European Alpine Military Rifle, That had a sleeve added by welding or silver solder to the end of its 40 Centimeter barrel, So it could be imported and sold in the USA.