Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
コードを短時間ごとに、たとえば100ミリ秒ごと(またはそれ以下)に実行する必要があります。
スレッドを生成してその中に無限ループを追加できると思いますが、これは良いことではないと思います。
TimerとTimerTaskを使用できます。
final Timer timer = new Timer(); final int period = 100; final int delay = 0; timer.schedule(new TimerTask() { @Override public void run() { log.debug("executing something"); } }, delay, period);