Measuring Pulse Width

Good to hear that it works, see you removed the cli()/sei() flags. They are not needed as the TCCR1B starts/stops the timer1. They were a leftovers of my experiments, sorry.

In the first microsecond Timer1 misses a few cpu ticks before it is started as the starting of Timer1 itself takes at least one instruction. That can be added in the formula later. Furthermore the 65535L should be 65536L. This results in the following code:

//
//    FILE: PulseWidthMeter.pde
//  AUTHOR: Rob Tillaart
//    DATE: 2012-apr-01
//
//    LINK: http://arduino.cc/forum/index.php?action=post;topic=96971.0
//

#include <avr/io.h>
#include <avr/interrupt.h>

volatile unsigned int count = 0;
unsigned int pulseCounter = 0;

void setup()
{
  Serial.begin(38400);
  Serial.println("PulseWidthMeter (timer1) 0.2");
  pinMode(3, INPUT);
}

void loop()
{
  // reset Timer1 registers and the counters (timer must be stopped before reset of counters!.
  TCCR1A = 0;
  TCCR1B = 0; 
  count = 0;
  TCNT1 = 0;
  TIMSK1 = (1 << TOIE1);                      // enable Timer1 overflow interrupt:

  while ((PIND & B00001000) == B00000000);    // wait for HIGH
  TCCR1B |= (1 << CS10);                      // Set CS10 bit so timer runs at clock speed: 16 MHz
  while ((PIND & B00001000) == B00001000);    // wait for low
  TCCR1B = 0;                                 // stop counting
  pulseCounter ++;

  // Read the counters and convert to long
  unsigned long total = count * 65536L + TCNT1;  // Might need a +1 to correct start/stop calibration. 
  float usec = (1.0 * total) / 16;

  // Display values
  Serial.print(total, DEC);
  Serial.print(" \t ");
  Serial.println(usec, 1);
  Serial.print("pulses: ");
  Serial.println(pulseCounter);
}

// count the overflows in IRQ
ISR(TIMER1_OVF_vect)
{
  count++;
}

Maybe move these statements from loop to setup, to make it absolutely minimal
TCCR1A = 0;
TCCR1B = 0;
TIMSK1 = (1 << TOIE1); // enable Timer1 overflow interrupt: