1.) Convert the measurements of Naomi's pets so that the two has the same unit of measurements. I will use cm.
1 mm = .01 cm;
Therefore: 40 mm = 4 cm is the length of the fish
2.) Subtract the pets' measurements:
25 cm - 4 cm = 21 cm
3.) Therefore, Naomi's guinea pig is 21 cm longer than her fish.