How to call function every hour? Also, how can I loop this?

前端 未结 4 1165
鱼传尺愫
鱼传尺愫 2021-02-05 14:17

I need a simple way to call a function every 60 minutes. How can I do this? I\'m making a MineCraft bukkit plugin, and this is what I have:

package com.webs.play         


        
4条回答
  •  南笙
    南笙 (楼主)
    2021-02-05 14:21

    1. The simplest way (in my opinion) is use Thread (the above comment has mention about it).
    2. You can also use Timer in javax.swing.Timer
    3. But i think - as 101100 said - you can use TimerTask. You can check this link (from IBM)

提交回复
热议问题