user19617: I want to know how much time has elapsed since a certain event, and I do not want to use any external timers. It seems logical to reset an internal timer whenever the event occurs (using an interrupt). Unfortunately, as far as I can tell, millis() and micros() cannot be manually reset. Obviously, I could save a time stamp whenever the event occurs; however, I want to avoid overflow problems (micros() will overflow every ~71 minutes, and millis() will overflow every ~50 days).
Is there a way to manually reset these built-in counters? If not, how can I manage the overflow?

user2881: Overflow is never really an issue if you always calculate time difference. (Unless the time difference is more that 50 days.)
unsigned long previousTime = millis();
... wait for some event to happen ...
unsigned long elapsedTime =  millis() - previousTime;

Even if previousTime was before the overflow, and millis() is after the overflow (so essentially millis()<previousTime), elapsedTime will still be the correct value. 
This is because the calculation itself will also overflow. Since millis()<previousTime, the result would be negative, but the type of the variable is unsigned, so it wraps around. I hope that makes sense.
Just don't ever do something like if( millis() > (previousTime+1000) )
If you still want to reset millis, you can use the following:
extern volatile unsigned long timer0_millis;
unsigned long new_value = 0;

void setup(){
  //Setup stuff
}

void loop(){
  //Do stuff
  //--------

  //Change Millis
  setMillis(new_value);
}

void setMillis(unsigned long new_millis){
  uint8_t oldSREG = SREG;
  cli();
  timer0_millis = new_millis;
  SREG = oldSREG;
}


user7508: millis() and micros() overflow periodically. However, this is not a
problem: as long as you compare durations instead of
timestamps you can
forget about the overflows.
The liked answer also gives the trick for resetting millis(). Can be
handy for testing purposes, but you do not need this to handle the
millis() rollover problem. Notice that there is no clean way to reset
micros(): it relies on a static variable, i.e. a variable private to
the file defining it.

19617: <p>I want to know how much time has elapsed since a certain event, and I do not want to use any external timers. It seems logical to reset an internal timer whenever the event occurs (using an interrupt). Unfortunately, as far as I can tell, <code>millis()</code> and <code>micros()</code> cannot be manually reset. Obviously, I could save a time stamp whenever the event occurs; however, I want to avoid overflow problems (<code>micros()</code> will overflow every ~71 minutes, and <code>millis()</code> will overflow every ~50 days).</p>

<p>Is there a way to manually reset these built-in counters? If not, how can I manage the overflow?</p>
 2881: <p>Overflow is never really an issue if you always calculate time difference. (Unless the time difference is more that 50 days.)</p>

<pre><code>unsigned long previousTime = millis();
... wait for some event to happen ...
unsigned long elapsedTime =  millis() - previousTime;
</code></pre>

<p>Even if <code>previousTime</code> was before the overflow, and <code>millis()</code> is after the overflow (so essentially <code>millis()</code>&lt;<code>previousTime</code>), <code>elapsedTime</code> will still be the correct value. </p>

<p>This is because the calculation itself will also overflow. Since <code>millis()</code>&lt;<code>previousTime</code>, the result would be negative, but the type of the variable is <code>unsigned</code>, so it wraps around. I hope that makes sense.</p>

<p>Just don't ever do something like <code>if( millis() &gt; (previousTime+1000) )</code></p>

<p>If you still want to reset millis, you can use the following:</p>

<pre><code>extern volatile unsigned long timer0_millis;
unsigned long new_value = 0;

void setup(){
  //Setup stuff
}

void loop(){
  //Do stuff
  //--------

  //Change Millis
  setMillis(new_value);
}

void setMillis(unsigned long new_millis){
  uint8_t oldSREG = SREG;
  cli();
  timer0_millis = new_millis;
  SREG = oldSREG;
}
</code></pre>
 7508: <p><code>millis()</code> and <code>micros()</code> overflow periodically. However, this is not a
problem: as long as you <a href="https://arduino.stackexchange.com/questions/12587">compare durations instead of
timestamps</a> you can
forget about the overflows.</p>

<p>The liked answer also gives the trick for resetting <code>millis()</code>. Can be
handy for testing purposes, but <em>you do not need this</em> to handle the
millis() rollover problem. Notice that there is no clean way to reset
<code>micros()</code>: it relies on a <code>static</code> variable, i.e. a variable private to
the file defining it.</p>
