View | Details | Raw Unified | Return to bug 51880
Collapse All | Expand All

(-)src/core/org/apache/jmeter/threads/JMeterThread.java (-3 / +17 lines)
Lines 209-217 Link Here
209
    private void startScheduler() {
209
    private void startScheduler() {
210
        long delay = (startTime - System.currentTimeMillis());
210
        long delay = (startTime - System.currentTimeMillis());
211
        if (delay > 0) {
211
        if (delay > 0) {
212
            try {
212
            long start = System.currentTimeMillis();
213
                Thread.sleep(delay);
213
            long end = start + delay;
214
            } catch (Exception e) {
214
            long now=0;
215
            long pause = RAMPUP_GRANULARITY;
216
            while(running && (now = System.currentTimeMillis()) < end) {
217
                long togo = end - now;
218
                if (togo < pause) {
219
                    pause = togo;
220
                }
221
                try {
222
                    Thread.sleep(pause); // delay between checks
223
                } catch (InterruptedException e) {
224
                    if (running) { // Don't bother reporting stop test interruptions
225
                        log.warn("startScheduler delay for "+threadName+" was interrupted. Waited "+(now - start)+" milli-seconds out of "+delay);
226
                    }
227
                    break;
228
                }
215
            }
229
            }
216
        }
230
        }
217
    }
231
    }

Return to bug 51880