23.4k views
1 vote
If one wish to create a loop such that it will continuously add time elapsed between two functions with variable computation time until 1 hour is passed, what type of loop would be best

1 Answer

5 votes

"Between two functions" not sure of what you mean there but here's a quick way to execute a function for an hour

Answer and Explanation:

var interval=setInterval(function(){

var i=0;

for (i=0; i <=60; i++){

for (i=0; i <70; i++){

console.log(i); }

}}, 60000);

User Issei
by
4.6k points