A few corrections...
[glow]volatile[/glow] long timer=0;
ISR(TIMER1_COMPA_vect) // Timer-1 OC1A Match interrupt handler
{
[glow]/* Remove. This serves no purpose. Interrupts are disabled when an ISR is called.
cli();
*/[/glow]
timer = micros();
TCNT1 = 0;
TIMSK1 = 1<<OCIE1A;
};
void loop()
{
delay(1000);
[glow]/* Accessing timer without first disabling interrupts is not safe.
Serial.println(timer);
*/[/glow]
}
I believe you're also missing SLI (interrupts enable command) at the end of the interrupt handler
This is not necessary. Reenabling interrupts is automatically performed.