6
I have to create a function in JavaScript
that takes all id’s from one table and makes a draw with id’s from the same table so that the same id does not fall with itself, and there is a possibility that that id may be in the other "house".
exps:
1|2 - 2|1... válido.
1|1 - 2|2... inválido.
Thus:
var teste = [];
for (var i = 1; i <= 305; i++) {
for (var x = 1; x <= 305; x++) {
if(x != i){
teste.push(i+'|'+x);
}
}
}
console.log(teste)
I wonder if there is any way to know how long this function takes to execute, since it generates more than 90 thousand records.
You want to measure runtime or estimate before running?
– bfavaretto
measure the run time according to the customer’s machine, but have an estimate tbm would come in handy rs
– MarceloBoni
A +- off-topic question, a function that generates +- 90thousand records and takes 27ms can be considered slow?
– MarceloBoni
I wouldn’t consider slow, especially when it comes to Javascript.
– bfavaretto