Java loop for a certain duration

后端 未结 8 2143
花落未央
花落未央 2020-12-13 22:10

Is there a way I can do a for loop for a certain amount of time easily? (without measuring the time ourselves using System.currentTimeMillis() ?)

I.e. I want to do s

8条回答
  •  鱼传尺愫
    2020-12-13 22:22

    No. That is sort of a strange request considering how simple it would be to simply write a function that uses System.currentTimeMillis() (or whichever time function you choose). More context of the situation might be in order.

提交回复
热议问题