Answer the question
In order to leave comments, you need to log in
How to make a function wait in JavaScript?
The loop for
calls a function imitate(j)
that performs an animation in WebGL and lasts 24 seconds.
Cycle:
for (j; j<=finDay; j++) {
imitate(j);
};
imitate = function(d) {
function startTrackInterval(day) {
if (day) effectController.day=day;
effectController.hour=0;
var timerId = setInterval(function() {
if (effectController.hour > 24) clearInterval(timerId);
else {
gui.updateDisplay();
tracker();
};
effectController.hour=effectController.hour+0.01;
}, 10);
}
startTrackInterval(d);
}
j
? finDay
the -th number of copies of the function almost in parallel, and the rendering turns out to be a mess. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question