Comparing two output

i don't see a print in the 2nd version of the code

i think the ISR is doing too much. with delays in loop() there's no guarantee that loop() is seeing all the captured values.

why not have the ISR capture values in a buffer, incrementing and wrapping an index with each capture? loop() would have it's own index and process samples from the buffer whenever the indices differ.