How to write a input counter data into EEPROM and retrieve it.?

that loop will run how many times per second, its in the tens of thousands unless you have some sort of delay built in.....