Sensors monitoring and extracting max values

Hi, I am working on a project in which I use 4 sensors, I want to monitor the four sensors at the same time for twenty seconds, and when each one of them reaches its maximum value during this period, I want to save the values ​​for the four sensors to perform some operations on them, any ideas on how to write the arduino code If this was even possible

I have a few ideas on how to write the code for a ESP32 using freeRTOS and it seems possible to me.

hello
I just want to write the Arduino code and I didn't use ESP32, I would appreciate your help with this

Ok, what have you got so far? Where are you stuck?

Code one sensor first. Post your code if it doesn’t work telling us precisely where it varies from the specs. Post a schematic of how you have it connected. When 1 sensor does what you want then add another etc

Monitor the actual values you are getting. Save the value into a variable. If the next value is less than then saved value, don't save it. At the end of your time period, the save values are the maximum values.