I have n parameters which have to be run in sequence for t seconds each. All the data is stored in an array which is loaded dynamically through ajax and json and exists of: function parameters p and time to sleep t
function(p1), for 30 seconds; when it completes function(p2) for 15 seconds etc etc
Until the array is complete; then we have to start all over.
The number of parameters and its time being displayed are not determined on forehand.
How can I implement this with javascript?
//edit:
I tried to make one big function with function(p1) starting at t=0; function(p2) starting at t=t1; function(p3) starting at t=t1+t3
But it felt ‘stupid’ and overdone….
I suspect you array looks like
In this case you could
Edit
And ofcourse
to start.