 float get_consumption_from_time_since_last_pulse(long timeSinceLastPulse) {
   long time = millis();
   long dsecs = (time - timeSinceLastPulse) / 100;
-  if(dsecs < 5) { //5 dsecs = 0.5 sec: the highest supported interval for this sketch.
+  if(dsecs < 4) { //4 dsecs = 0.4 sec: the highest supported interval for this sketch.
     time_since_last_pulse = time;
     return 0.0F;
   }

          EEPROM_writeAnything(EEPROM_READ_ADDR, storage);
        }
        yield();
        consumption_current = get_consumption_from_time_since_last_pulse(time_since_last_pulse);
        dtostrf(storage.consumption_total + ((((float)storage.pulse_count_current_kwh) * WH_PER_PULSE) / 1000.0F), 6, 2, consumption_total_str);
        dtostrf(consumption_current, 4, 0, consumption_current_str);
        time_since_last_pulse = millis();
        pulse_triggered = false;
        yield();


#define EEPROM_READ_ADDR 0

struct config_t
{
  int state;
  double consumption_total;
  int pulse_count_current_kwh;
} storage;

double particle_total_kwh = 0;
char consumption_total_str[10] = "00000.00";

double particle_consumption_current = 0;
char consumption_current_str[6] = "Wait";

long time_since_last_pulse = millis();
