📜  android timer - Go 编程语言代码示例

📅  最后修改于: 2022-03-11 14:44:59.592000             🧑  作者: Mango

代码示例2
private int counter;

TimerTask timerTask = new TimerTask() {
    @Override
    public void run() {
        Log.e("TimerTask", String.valueOf(counter));
        counter++;
    }
};

Timer timer = new Timer();
timer.schedule(timerTask, 0, 1000);