user45654: This is my code for a timer. My goal is to increment the count at every 1 sec.
unsigned int count = 0;
int wait = 1000;

void setup()
{
  Serial.begin(9600);
}
void loop()
{
  long current = millis();
  if((millis() - current) == wait)
  {
    count++;
  }
  Serial.println(count);
}

but the serial monitor is only showing zeroes. what to do?

user4143: millis() - current will always be 0 because current is always set to the value of millis() right before you compare it.  So it will never equal wait (0 is not 1000), so count never increments.

45654: <p>This is my code for a timer. My goal is to increment the <code>count</code> at every 1 sec.</p>

<pre><code>unsigned int count = 0;
int wait = 1000;

void setup()
{
  Serial.begin(9600);
}
void loop()
{
  long current = millis();
  if((millis() - current) == wait)
  {
    count++;
  }
  Serial.println(count);
}
</code></pre>

<p>but the serial monitor is only showing zeroes. what to do?</p>
 4143: <p><code>millis() - current</code> will always be <code>0</code> because <code>current</code> is always set to the value of <code>millis()</code> right before you compare it.  So it will never equal <code>wait</code> (0 is not 1000), so <code>count</code> never increments.</p>
