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
Try this:
while(true) { if(System.getNanotime % 20 == 0) { myFunction(); } }
This is in Java-Syntax, i didn't program c since more than 5 years, but maybe it helps you :)