You are here

Getting TestComplete to wait for more available CPU Power

Sometimes while running tests, the CPU usage can get higher than wanted. If the test get unstable due to this. The little trick can help you wait for more CPU power.

function TestCPUUsage()
{
// Will wait for the used CPU power to get below 5%
while(Sys.CPUUsage > 5){
Delay(2000, "CPU usage: " + Sys.CPUUsage);
}
}