long totalTimeTaken = results[1].getTestTime() + results[1].getInitTime() - results[0].getInitTime();
long totalTimeTaken = results[1].testTime + results[1].initTime - results[0].initTime;
   protected void runMessageTypeJob(Execution execution, MessageFactory mf, String messageType, int type)   {      runJob(createDefaultDrainJob(queueName));      SenderJob sender = createDefaultSenderJob(queueName);      sender.setNumMessages(numMessages);      sender.setMsgSize(4096);      sender.setMf(mf);      sender.setTransacted(false);      sender.setDeliveryMode(DeliveryMode.PERSISTENT);      sender.setSlaveURL(slaveURLs[0]);            ReceiverJob receiver = createDefaultReceiverJob(queueName);            receiver.setAckMode(Session.AUTO_ACKNOWLEDGE);      receiver.setTransacted(false);      receiver.setSlaveURL(slaveURLs[1]);            JobTimings[] results = runJobs(new Job[] {sender, receiver});            /*       * NB.       * When we calculating the total time taken from first send to last receive, there is some       * error involved due to the differences in network latency and other remoting overhead       * when sending the jobs to be executed on potentiall different remote machines.       * We make the assumption that this this difference is very small compared with time taken       * to run the tests as to be negligible.       */            long totalTimeTaken = results[1].getTestTime() + results[1].getInitTime() - results[0].getInitTime();            Measurement measure = new Measurement("msgsSentPerSec", 1000 * (double)numMessages / totalTimeTaken);            measure.setVariableValue("messageType", (double)type);      execution.addMeasurement(measure);   }