Hi all:
I have a demand, triggered at a specified time (such as May 1, 2010
16:28:00) to perform an operation.

I use java.util.concurrent.ScheduleExecutorService to perform scheduling
tasks:

scheduleExecutor.schedule (task, targetDateTime.getTime
()-System.currentTimeMillis (), TimeUnit.MILLISECONDS)

But I found in the log begin the task of the time is 16:2749, ahead by 10
seconds.

Then, I used to do the test java.utill.Timer. When I use the Timer to
schedule, the program began execution time and expected difference is small.
When using ScheduleExecutorService scheduling, almost always in advance.

Why?

My test environment is:
JDK 1.6.0_18
OS Windows XP sp3

Thanks.

-- 
d0ngd0ng

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to