This question already has answers here: 开发者_如何学运维Closed 12 years ago. Possible Duplicates:
Is there a way I can do a for loop for a certain amount of time easily? (without measuring the time ourselves using System.currentTim开发者_如何学JAVAeMillis() ?)