You never reinitialize your time waster to 1000.

It would probably be better to treat time waster as a constant and use a for loop and compare i against tw.