read timer 1

hi
i want to Reads the time since last restart in microseconds . i am using timer1 in arduino uno .

but what code i should use ?

thank you
best regards

[u]micros()[/u].

Are you trying to get the time in microseconds since last restart? Or are you trying to do something with timer1?

millis() and micros() use timer0 (which is why libraries generally don't use that timer - to avoid breaking millis() and micros() )

i want to do this (but frq of pin 5 must be 200hz )!

                                         //step 1
void loop() {
  digitalWrite(5, LOW);
  delayMicroseconds(x);
  digitalWrite(5,HIGH);
  Timer1.restart();
  // analogRead & delay .... here 
     //
     //
  //4800-readtimer1 in microseconds!
  delayMicroseconds(4800-readtimer1 in microseconds);


                                                  //step 2
    digitalWrite(5, LOW);
  delayMicroseconds(x);
  digitalWrite(5,HIGH);
  Timer1.restart();
  // analogRead & delay .... here 
     //
     //
  //4800-readtimer1 in microseconds!
  delayMicroseconds(4800-readtimer1 in microseconds);



                                                   // step n

To read the Timer1 counter register:

unsigned int count=TCNT1;

For this to be useful, the timer has to be set up correctly. Keep in mind that certain Arduino functions use Timer1.