Just move the mouse. Space to switch modes. In the speed test, I'm getting around 2000 squares per second when I draw 500 at a time. :)
All by me. It has a glitch where when you make the rect small, it becomes hollow. :/ If you find a fix for this, please tell me! Only 2 variables = count and size. This uses a bit of recursion to avoid the variables x1, y1, x2, and y2!