It runs through 256 different delay amounts inside the IRQ, then starts over with the next DMC frequency, and so on. Pressing left/right changes the number of segments making up the wave (and also resets the delay and DMC freq).
I put a big delay loop in the code also, you can see the highest IRQ delay settings really dig into it. But the CPU usage can be really low with the right settings.