The code looks like it should run fine. How are you executing it and what makes you think it "times out"?
The code looks like it should run fine. How are you executing it and what makes you think it "times out"?