| //------------------------------------------------------------------------------------------------------- |
| // Copyright (C) Microsoft. All rights reserved. |
| // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. |
| //------------------------------------------------------------------------------------------------------- |
| |
| /* |
| ***************PERF TEST******************** |
| * Test for middle case hit with all integer case values and empty cases. |
| */ |
| |
| function f(x) |
| { |
| switch(x) |
| { |
| case 1: |
| case 2: |
| case 3: |
| case 4: |
| case 5: |
| case 6: |
| case 7: |
| case 8: |
| case 9: |
| case 10: |
| case 11: |
| case 12: |
| case 13: |
| case 14: |
| case 15: |
| case 16: |
| case 17: |
| case 18: |
| case 19: |
| case 20: |
| case 21: |
| case 22: |
| case 23: |
| case 24: |
| case 25: |
| case 26: |
| case 27: |
| case 28: |
| case 29: |
| case 30: |
| case 31: |
| case 32: |
| case 33: |
| case 34: |
| case 35: |
| case 36: |
| case 37: |
| case 38: |
| case 39: |
| case 40: |
| } |
| |
| } |
| |
| var _switchStatementStartDate = new Date(); |
| |
| for(i=0;i<10000000;i++) |
| { |
| f(21) |
| } |
| |
| var _switchStatementInterval = new Date() - _switchStatementStartDate; |
| |
| WScript.Echo("### TIME:", _switchStatementInterval, "ms"); |
| |