Saturday, 7 September 2013

Start Multiple java TimerTasks at the same time

Start Multiple java TimerTasks at the same time

Is it possible to schedule multiple TimerTasks such that they all begin at
the same time and if so how would I do it? In particular I would like to
initiate these tasks at the same exact time so that the relative time
difference between each task is as specified (I want to be as accurate as
possible).
toneIntervalClock.scheduleAtFixedRate(tonePlayerTask, 250, 5000);
startRecordingClock.scheduleAtFixedRate(startRecordingTask,0,5000);
stopRecordingClock.scheduleAtFixedRate(stopRecordingTask, 1000, 5000);
Also would it be better practice to use the same Util Timer to schedule
each task? Thanks

No comments:

Post a Comment