There are many different ways to measure calories. The most widely known and widely used one is called a bomb calerimeter. It is a sealed container that is filled with pure oxygen, and it is suspended in a container of water. You put your snicker's bar, say o, determine how many calories are in it, you ignite it using electrical fuses. And you've got a thermometer in that bath of water.