Java programming packets per second for stress tester
<p>I need to write a stress tester for an application I've developed.  Java is the language of choice, as the other testing features needed are already implemented and in Java.  My last need is to be able to specify a "packets per second" rate and stress test the application being tested.  What is the best way to implement the rate limiter?  The only thought I had was basic math to figure out how many milliseconds between packets will get me the desired pps, however shouldn't that be off then by other threads/processes getting on the CPU?  Or are pps rates in general low enough that it won't make a measurable difference?  I think the stress test is going to fall somewhere between 80 and 150 pps.</p>
