depending on the size of the interior to be measured, you could use either a laser measuring device which is very accurate or as simple as two pieces of straight wood held together that you make a pencil mark anywhere along before removing them from the cabinet and then you would place them back together at the pencil mark and them measure the total length.
I like to use a Bosch laser device to make measurements for anything much larger than 4' or so.