Calculate gas consumption