ESP8266 Interrupt

Current micros is more than previous micros, so answer would be negative. But you're using unsigned long so negative overflows to huge positive. Reverse the order of subtraction