Can any one provide reference on Arduino concerning this?
HOW accurate?
Arduino is pretty much a bare AVR chip. There is essential no "operating system other than one background interrupt that would introduce less than about 10 microseconds of latency. It's ability to accurately time events for 'real time' uses will be almost entirely dependent on how YOU write the software...
Oh. I thought there were some Arduino language facilities for this.
Can you say a little more about what you want to do?
Have you looked at the Thomas Ouellet Fredericks Metro library?
Ive just used it for timing/prioritising key presses, lcd display and temperature readings on something Im working on.
Its on the arduino.cc site.
http://www.arduino.cc/playground/Code/Metro
What it doesnt specifically say, in the documentation, is you can create an instance for each of the events you want to time.
Please excuse my pseudo code.
Creating the instances
Metro lcdMetro = Metro(1000); // 1 second
Metro keyMetro = Metro(250); // 250 milliseconds
and in the loop()
if (lcdMetro.check() == 1){
DoSomething();
}
if (keyMetro.check() == 1){
DoSomethingElse();
}
You will have to watch how long everything takes within the loop.
Simple and effective if it is granular enough for you.
Its made the response to key presses snappier in my application as the checks on key presses happen more often than the lcd display gets changed.
Gordon