The processing you want to perform is not in the Simulink standard block. So I modeled the function you want to detect.
It is created with Simulink standard blocks only. I created this model with R2021a
You can use this model by setting start_time and stop_time to start and end times.