Finding rise time and amplitude

Thanks. I tried your suggestion about serial in loop and it works. One more thing. Like your code I also have to find amplitude (to get electrical conductivity) but that will require finding the minimum and maximum and for that input data is required to be read by analogRead. I know it cannot be read on the same pin while interrupt is in use. I see in your code for ESP32 (mine right now is STM32) that you read the data first (to get amplitude) and then call the interrupts to find time. With my code how can I read the signal from the same pin?