gpt4 book ai didi

java - 一段时间后如何做do/while?

转载 作者:行者123 更新时间:2023-12-01 18:44:17 25 4
gpt4 key购买 nike

我想做这样的事情:

@Override
protected String doInBackground(Object... params) {
int i = 0;
int max = Integer.MAX_VALUE;
GPSTracker gps = new GPSTracker(context);
do
{
//Something

} while(10 seconds);

return null;

}

如何在 while 语句中输入计数时间。我想在 10 秒内完成这个。

最佳答案

如果您想定期运行任务,请使用 Timer#scheduleAtFixedRate .

关于java - 一段时间后如何做do/while?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18516496/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com