In U.S. practice, the length of a barrel includes the chamber, except in the case of revolvers. Some other nations measure only the rifled portion.
To measure a revolver's barrel, place a flat surface against the forcing cone and insert a cleaning rod of the proper diameter until it stops. Mark the rod at the muzzle and then measure between the end of the rod and the mark.
On any other gun, simply insert the rod with the action closed, mark the muzzle point, remove and measure.
It should be noted that for legal purposes, the actual measurement is what counts, not the nominal barrel length listed in a catalog or instruction book.
Photos by Dick