Continue cooking until the solids sink and you don’t see steam rising any more. Butter has water, which you are removing with this process, and solids, which you are caramelizing to give the cookies a rich nuttiness. Reduce heat slightly to prevent scorching, and swirl the pan periodically. If bits look stuck, scrape them loose with a spatula. Your goal is to prevent scorching.