#include <stdio.h> #include <unistd.h> int main(void) { // Make sure program is not finished before pb scheduler takes control sleep(1); int a = 0; int b = 0; for (;b < 100; b++) { for (;a < 100000; a++){asm("");} // check if program runs && syscall to switch tasks printf("loop run: %d \n", b); usleep(1); } return 0; }