Let's say that for example I have a for loop which is reading instructions line by line from a .txt file and what I wish to do is make the program execute those instructions once every second or so. How can I possibly do this?
Here's the code for my loop:
for(j = 0; j < PC; j++) {
txtfilepointer = fopen(listWithTxtFilesToRead[j].name, "r");
while (fscanf(txtfilepointer, "%c %s", &field1, field2) != EOF ) {
// here it should be executing the given instruction every second or so...
printf("whatever the instruction told me to do");
}
}
Please ignore the variable names, it's just for examplifying.