Closed FlorianK13 closed 2 months ago
Something like this:
function runSimulation(steps, progressCallback) { for (let step = 0; step < steps; step++) { simulateStep(step); const progress = (step + 1) / steps * 100; progressCallback(progress); } } function updateProgressBar(progress) { console.log(`Progress: ${progress}%`); // Replace this with actual UI update logic } runSimulation(100, updateProgressBar);
Something like this: