How accurate are delays within loops

It will be about as long as it takes for you to completely kill your EEPROM.

Storing a value to EEPROM that frequently is just plain stupid. I'm sorry, but it is.

The EEPROM can only be written to a finite number of times. Approximately 100,000 times. At 40 times per second, that's 100,000/40 = 2500 seconds. That's a little over 41 minutes.

Stop now, before you go any further, and re-think just what you really want to do.

As for calculating how long the loop will take? Well, that depends on two factors:

  1. The number of instructions (and hence the number of clock cycles) the loop compiles into.
  2. The number of times the EEPROM has been written to - it slows down with use as it takes longer and longer to erase the cell before writing to it after a while. The death of an EEPROM cell isn't actually the cell dying per se, but the fact that it takes longer than a threshold timeout to erase.