/** * Start a new {@link JMeterThread} and registers it * @param notifier {@link ListenerNotifier} * @param threadGroupTree {@link ListedHashTree} * @param engine {@link StandardJMeterEngine} * @param threadNum Thread number * @param context {@link JMeterContext} * @param now Nom in milliseconds * @param delay int delay in milliseconds * @return {@link JMeterThread} newly created */ private JMeterThread startNewThread(ListenerNotifier notifier, ListedHashTree threadGroupTree, StandardJMeterEngine engine, int threadNum, final JMeterContext context, long now, int delay) { JMeterThread jmThread = makeThread(notifier, threadGroupTree, engine, threadNum, context); scheduleThread(jmThread, now); // set start and end time jmThread.setInitialDelay(delay); Thread newThread = new Thread(jmThread, jmThread.getThreadName()); registerStartedThread(jmThread, newThread); newThread.start(); return jmThread; }
jmThread.setInitialDelay(0); // Already waited if (usingScheduler) { jmThread.setScheduled(true);