• I'd imagine the issue is:

    var now = getTime();
    var pulsetime = now - lastpulse;

    If this gets called twice in quick succession then the second time it's called you'll get a very small time period reported. setWatch does actually have an option called debounce that will automatically discount any spikes off less than the given length in milliseconds, so you could try that


Avatar for Gordon @Gordon started