Index: C:/Documents and Settings/alf/workspace/Jmeter 2.2 writable/src/core/org/apache/jmeter/control/TransactionSampler.java
===================================================================
--- C:/Documents and Settings/alf/workspace/Jmeter 2.2 writable/src/core/org/apache/jmeter/control/TransactionSampler.java	(revision 552554)
+++ C:/Documents and Settings/alf/workspace/Jmeter 2.2 writable/src/core/org/apache/jmeter/control/TransactionSampler.java	(working copy)
@@ -27,13 +27,18 @@
 import org.apache.jmeter.samplers.Entry;
 import org.apache.jmeter.samplers.SampleResult;
 import org.apache.jmeter.samplers.Sampler;
+import org.apache.jmeter.samplers.TransactionSampleResult;
+import org.apache.jmeter.util.JMeterUtils;
 
 /**
  * Transaction Controller to measure transaction times
  * 
  */
 public class TransactionSampler extends AbstractSampler {
-  private boolean transactionDone = false;
+	private static final boolean DURATION_AS_SUM_OF_SUBSAMPLES 
+    = JMeterUtils.getPropDefault("TransactionController.duration_is_sum_of_subsamples", false);// $NON-NLS-1$
+	
+	private boolean transactionDone = false;
 
     private TransactionController transactionController; 
     
@@ -52,7 +57,15 @@
 	public TransactionSampler(TransactionController controller, String name) {
         transactionController = controller;
 		setName(name); // ensure name is available for debugging
-		transactionSampleResult = new SampleResult();
+		// Check if duration should be reported as actual time to
+		// complete the transaction, or just as the sum of the duration
+		// of the subsamples
+		if(!DURATION_AS_SUM_OF_SUBSAMPLES) {
+			transactionSampleResult = new SampleResult();
+		}
+		else {
+			transactionSampleResult = new TransactionSampleResult();
+		}
 		transactionSampleResult.setSampleLabel(name);
 		// Assume success
 		transactionSampleResult.setSuccessful(true);
Index: C:/Documents and Settings/alf/workspace/Jmeter 2.2 writable/src/core/org/apache/jmeter/samplers/TransactionSampleResult.java
===================================================================
--- C:/Documents and Settings/alf/workspace/Jmeter 2.2 writable/src/core/org/apache/jmeter/samplers/TransactionSampleResult.java	(revision 0)
+++ C:/Documents and Settings/alf/workspace/Jmeter 2.2 writable/src/core/org/apache/jmeter/samplers/TransactionSampleResult.java	(revision 0)
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+
+package org.apache.jmeter.samplers;
+
+/**
+ * This is a class for handling TransactionSample results, so that the
+ * duration is reported as the sum of the duration of the subsamples of
+ * the transaction.
+ */
+public class TransactionSampleResult extends SampleResult {
+    private boolean hasCalculatedDuration = false;
+
+	/**
+	 * @return the end time
+	 */
+	public long getEndTime() {
+		if(!hasCalculatedDuration) {
+			calculateDuration();
+		}
+		return super.getEndTime();
+	}
+	
+	public long getTime() {
+		if(!hasCalculatedDuration) {
+			calculateDuration();
+		}
+		return super.getTime();
+	}
+	
+	private void calculateDuration() {
+		SampleResult[] subResults = getSubResults();
+		if(subResults != null) {
+			long duration = 0l;
+			for(int i = 0; i < subResults.length; i++) {
+				duration = subResults[i].getTime();
+			}
+			setEndTime(getStartTime() + duration);
+		}
+		hasCalculatedDuration = true;
+	}
+}
Index: C:/Documents and Settings/alf/workspace/Jmeter 2.2 writable/bin/jmeter.properties
===================================================================
--- C:/Documents and Settings/alf/workspace/Jmeter 2.2 writable/bin/jmeter.properties	(revision 552554)
@@ -528,6 +530,15 @@
 # Default is true. Use false to revert to original behaviour
 #CookieManager.delete_null_cookies=true
 
+# TransactionController behaviour - should duration be reported as actual
+# duration from start of transaction until transaction is done. This will
+# include time spent running Jmeter pre- and postprocessors, timers,
+# and assertions.
+# If the flag is false, or not present, actual duation will be reported.
+# If the flag is true, then the duration will be reported as the sum of
+# the duration of the subsamples.
+#TransactionController.duration_is_sum_of_subsamples=true
+
 # (2.0.3) JMeterThread behaviour has been changed to set the started flag before
 # the controllers are initialised. This is so controllers can access variables earlier. 
 # In case this causes problems, the previous behaviour can be restored by uncommenting
