Time limit on for(int loop

PaulS:

int doNothingFlag;

This variable only takes on two values - 0 or 1. Making it a boolean, instead, would make your code much more readable.

int doNothingFlag = 0;

Of course, doing so will really screw things up when you have a local variable of the same name and different type. Local and global variables of the same name are rarely a good idea.

if ( (doNothingFlag == 0) && (now - lastCycleTime > mixer) )

{
  doNothingFlag = 1;



would become:


if ( doNothingFlag && (now - lastCycleTime > mixer) )
{
  doNothingFlag = false;

So its like changing the 0&1's to true or flase. And if I go this route I'm not using a 0 or 1 command, I'm using any word I want with a true and false "value".
Is that correct?