wmtan01
6 years agoContributor
Most efficient way to increment a value
Hi,
I was trying out different ways to increment an integer and noticed that the fastest way to increment an integer is to actually pass it to another script routine rather than actually using code snippets or code expressions to assign a value. Does anyone know why testcomplete works like this or if I'm missing something with how I make code expressions that's why it's taking longer?
Three ways tested:
- Using the Set Variable operation with Code Expression as the value
- Passing the variable and 1 to a script routine which would return the incremented value and set the variable to Last Result
- Using a Run Code Snippet operation and set the variable to Last Result
Here are the results:
Method 1 took 321s :smileyindifferent:
Method 2 took a mere 11s!!!!!
Method 3 took 324s :smileyindifferent: