Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <cfscript>
- // Instantiate components
- Variables.testCom = createObject('component', 'com.testCom').init();
- // Set list of category IDs
- Variables.CategoryIDs = 'T1,T1C,T2,T2B,T25,Ghia,T3,G1,G1C,CADDY,G2,SC1,T4,CO,MISC';
- // Get struct for inline testing
- Variables.Categories = Variables.testCom.getVehicleCategories();
- // Loop counter
- Variables.Loop = 100000;
- Variables.Tick = getTickCount();
- // Loop
- for (x = 0; x < Variables.Loop; x++){
- // Select random ID
- Variables.ThisID = GetToken(Variables.CategoryIDs, randRange(1,ListLen(Variables.CategoryIDs)), ',');
- // Get category
- Variables.Category = Variables.testCom.getCategory(Variables.ThisID);
- }
- Variables.Tock = getTickCount();
- writeOutput('<h1>Component</h1>');
- writeOutput('#Val(Variables.Tock - Variables.Tick)#<br/>');
- Variables.Tick = getTickCount();
- // Loop
- for (x = 0; x < Variables.Loop; x++){
- // Select random ID
- Variables.ThisID = GetToken(Variables.CategoryIDs, randRange(1,ListLen(Variables.CategoryIDs)), ',');
- // Get category
- Variables.Category = Variables.Categories[Variables.ThisID];
- }
- Variables.Tock = getTickCount();
- writeOutput('<h1>Inline code</h1>');
- writeOutput('#Val(Variables.Tock - Variables.Tick)#<br/>');
- </cfscript>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement