a possibly cleaner way to write this, albeit with a variable, would be as follows
while(true){ static uint64_t c;
static allows you to declare a variable inside the loop in which IMHO looks cleaner. If your code, which is executed every time, makes some verifiable changes, you can get rid of the variable and write it like this:
while(true){ // some code that executes every time if(STATE_YOUR_LOOP_CHANGES == INITIAL_STATE){ // some code that executes only once } // some more code that executes every time. }
source share