zoukankan      html  css  js  c++  java
  • java小工具——timer

    定时器Timer

    用途:做定时器用的。

    public static void main(String[] args) {
    Timer timer = new Timer();
    timer.schedule(new TimerTask() {
    @Override
    public void run() {
    System.out.println("hello!");
    }
    },new Date(System.currentTimeMillis()+5000),1000); //延迟5s执行,没1s执行一次
    }
  • 相关阅读:
    01
    商城管理系统
    10
    09
    08
    07(3)
    07(2)
    07
    06
    jsp第一次作业
  • 原文地址:https://www.cnblogs.com/xujie09/p/10322361.html
Copyright © 2011-2022 走看看