If you want to trigger the functions "first-one", "the-second"..., then consider utilizing the setTimeout(fn, time)
function with a calculated interval. An example of pseudocode could be:
data = ["00-00-02":"first one", "00-00-04":"the second", "00-00-09":"third",...];
//utilizing [key: value] notation
for (i=0; i<data.length; i++) {
eventTime = timeInMilliSeconds(data[i].key);
setTimeout(printMyMessage(data[i].value, eventTime);
}
Alternatively, you may opt to call the setTimeout()
for data[i]
within the function call printMyMessage()
for data[i-1]
. In this scenario, the second argument for the setTimeout()
function would be the time difference between data[i]
and data[i-1]
.