Instrumentation by Squish can have an effect on the GUI performance of an application. For example, clicking a button to open a dialog may take 10ms when run without Squish, and 20ms or more when run with Squish.
This is important to keep in mind when measuring time required for certain operations in your application.
Simple time measuring¶
A very simple implementation for measuring time of some operations could look like this (Python):
Simple time measuring with calculation of average time required¶
Performing the desired operation n number of times and calculating the average time required can be useful to ensure that an operation more consistently performs as desired, not just once. (Although this should probably also include checking for values which cause a fail, regardless of the average. The example below does not do this however.)
Here is a simple implementation which calculates and checks the average time instead (Python):
Measuring absolute time required for executing n number of times¶
Another example (Python):