# Ejecution Time on "for" calculations

Hi! I'm doing a "for" calculation based on Categories of Items for a Sales & Inventory control, then I wonder if in the future when the app will have e.g. thousands of items, this calculation will take long time to update the value.. Has somebody experimented something like this?

The calculation is the following;

var depent = @All of Depósito;

var estp = @All of Estado Pedido;

var depsal = @All of Retirar de...;

var ent = 0;

var sal = 0;

var sck = 0;

for(var h = 0; h < depent.length; h++) {

if (depent[h] == "Dep. 2") { ent = ent }

else { ent = ent + @All of Entrada[h] };

}

for(var i = 0; i < estp.length; i++) {

if ((estp[i] == "Verif. Stock") || (depsal[i] == "Dep. 2"))

{ sal = sal }

else { sal = sal + @All of Cantídad[i] };

}

sck = ent - sal;

sck

Thanks and regards!

Please sign in to leave a comment.

## Comments

3 comments