How to assign multiple tasks using java.util.Timer
. I want to read multiple files using timers. I think I should give each file a different TimerTask
, so that one file gets one instance of TimerTask
and the other file gets another, but I don't know how to do it. Please help. Thanks in advance. That's what I'm doing:
Timer timer = new Timer(); // repeat the check every second timer.schedule(fileWatcherTask, new Date(), 1000);
source share