title: How to debug code that never stops running?
body: <p>I have a large code base, and something is now taking too long to execute. I have no idea what.</p>
  
  <p>The code never raises an exception, it just appears to keep on processing something.</p>
  
  <p>What I'd like to do is place timers around some functions to test which one is the culprit. But I'm not sure if that is the right approach, or how to do it.</p>
  
  <p>I can't easily raise exceptions at points around the code, because there are various loops that call the same functions, that perhaps only sometimes take too long.</p>
  
  <p>What is the best strategy?</p>