I have to know when 2 ms passes in a loop where elapsed code time is not predictable. The timing is not critical a few 100 us resolution is fine. I was thinking the watch dog could do this for me. How can I check the status of the watch dog? I'd like to avoid interrupts if possible.
Something like this, so that my code will run for around 2 ms.
DoThisCode();// could take from 100 us to 1ms.
If ( watchdogTime > 2ms ) break