<!--- 
 Filename: FlushTest.cfm
 Created by: Nate Weiss (NMW)
 Purpose: Demonstrates use of <cfflush> for incremental page output
--->

<html>
<head><title>&lt;cfflush&gt; Example</title></head>
<body>
 
 <!--- Initial Message --->
 <p><strong>Please Wait</strong><br>
 We are processing your order.<br>
 This process may take up to several minutes.<br>
 Please do not Reload or leave this page until the process is complete.<br>
 
 <!--- Flush the page output buffer --->
 <!--- The above code is sent to the browser right now --->
 <cfflush>
 
 <!--- Time-consuming process goes here ---> 
 <!--- Here, ColdFusion is forced to wait for 5 seconds --->
 <!--- Do not use this CFLOOP technique in actual code! --->
 <cfset initialTime = now()>
 <cfloop condition="dateDiff('s', initialTime, now()) lt 5"></cfloop>
 
 <!--- Display "Success" message --->
 <p><strong>Thank You.</strong><br>
 Your order has been processed.<br>
 
</body>
</html>
