TIMER
 
Syntax

TIMER
Description


TIMER is a free running timer that increments every microsecond.  It is readable  using this keyword.  You can also write to the TIMER register.

Operations that require more precise timing should use the dedicated hardware routines, as interupts that are occuring for other time functions and serial input may make times using TIMER look longer than actual.

Example

    int save_time;  // must be signed to handle roll-over
 
    save_time = TIMER;
    while ((TIMER - save_time) < 15) ;     // wait 15 uSec
   TIMER = 0;   // reset the free running timer
See also