simiane

23109682 Test: index.cfm

Apr 16th, 2014
190
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <cfscript>
  2.     // Instantiate components
  3.     Variables.testCom   = createObject('component', 'com.testCom').init();
  4.  
  5.     // Set list of category IDs
  6.     Variables.CategoryIDs   = 'T1,T1C,T2,T2B,T25,Ghia,T3,G1,G1C,CADDY,G2,SC1,T4,CO,MISC';
  7.  
  8.     // Get struct for inline testing
  9.     Variables.Categories    = Variables.testCom.getVehicleCategories();
  10.  
  11.     // Loop counter
  12.     Variables.Loop = 100000;
  13.  
  14.    
  15.  
  16.     Variables.Tick = getTickCount();
  17.     // Loop
  18.      for (x = 0; x < Variables.Loop; x++){
  19.         // Select random ID
  20.         Variables.ThisID = GetToken(Variables.CategoryIDs, randRange(1,ListLen(Variables.CategoryIDs)), ',');
  21.  
  22.         // Get category
  23.         Variables.Category = Variables.testCom.getCategory(Variables.ThisID);
  24.     }
  25.     Variables.Tock = getTickCount();
  26.     writeOutput('<h1>Component</h1>');
  27.     writeOutput('#Val(Variables.Tock - Variables.Tick)#<br/>');
  28.  
  29.  
  30.     Variables.Tick = getTickCount();
  31.     // Loop
  32.      for (x = 0; x < Variables.Loop; x++){
  33.         // Select random ID
  34.         Variables.ThisID = GetToken(Variables.CategoryIDs, randRange(1,ListLen(Variables.CategoryIDs)), ',');
  35.  
  36.         // Get category
  37.         Variables.Category = Variables.Categories[Variables.ThisID];
  38.     }
  39.     Variables.Tock = getTickCount();
  40.     writeOutput('<h1>Inline code</h1>');
  41.     writeOutput('#Val(Variables.Tock - Variables.Tick)#<br/>');
  42. </cfscript>
RAW Paste Data