function - RE: check for every X increment in C -
I have a function that automatically runs every second, inside the function I have a counter "i" Increases from 1 to 1 second. I do not want to run stuff on every second, but every x seconds every 10 seconds.
So I think the best way is to find I increment increments, when it grows by 13? Or a timer / sleep function calling for the function to wait?
Question: How can I find out the increment i.e. how do I check, if "i" increases to 13?
zero function (zero) {static int i = 0; If (every i seconds) {something} i ++; }
Thanks for any help
I think Looking for that modulo operation ():
zero function (zero) {static int i = 0; Int x = 13 if (i% x == 0) {make something} i ++; }
Comments
Post a Comment