I want to call a function, lets say every 10 or 20 seconds. When I searched, I came up with threads and sleep() method everywhere.
sleep()
I also checked for time
Simple:
#include #include int main(int argc, const char** argv) { while(1) { usleep(20000) ; printf("tick!\n") ; } }
Note that usleep() will of course block :)