Meaningless Drivel is fun!*
The moose likes Swing / AWT / SWT and the fly likes ScheduledThreadPoolExecutor running 15 milliseconds late only outside of IDE? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "ScheduledThreadPoolExecutor running 15 milliseconds late only outside of IDE?" Watch "ScheduledThreadPoolExecutor running 15 milliseconds late only outside of IDE?" New topic
Author

ScheduledThreadPoolExecutor running 15 milliseconds late only outside of IDE?

Nathan deNoyelles
Greenhorn

Joined: Jul 02, 2012
Posts: 5
Hi everyone I hope someone can help me with this problem. I've been creating countless test programs and researching non stop but can't seem to find an answer.

All I'm doing is creating a ScheduledThreadPoolExecutor and scheduling it at a fixed rate of 3 milliseconds. The problem is the rate at which it executes isn't consistent. It executes for awhile at 5 milliseconds and then jumps to random spikes of 15 - 20 milliseconds and just goes crazy trying to catch up.

The problem doesn't occur inside an IDE and only occurs outside the IDE running from the command line or from a Jar. Strange huh... I created a simple test case below that's easy to compile. If you want too see the problem make sure to run it outside of an IDE through the command line.

Thank You for your help!

I'm using:
Java 7 Update 5
Windows 7
IntelliJ IDE

Been tested using:
Java 7
Windows 7, Windows 8
NetBeans IDE, IntelliJ IDE



Variation of the question posted here:
http://stackoverflow.com/questions/11836351/java-scheduledthreadpoolexecutor-running-15-milliseconds-late-inconsistent-tim
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ScheduledThreadPoolExecutor running 15 milliseconds late only outside of IDE?