The execution time of the S-function depends on the processing task and the CPU. Generally, more complex task, more time. More powerful CPU, less time.
In simulation, it doesn't really matter. It could take 1 second to finish the task, and then the simulation moves to the next 0.1 time step. There is no constrain between the sample time and processing time. The speed of the simulation calculation could be faster or slower than the simulation clock. You can use Simulink Profiler to find out the processing time of each block.
In real-time simulation/execution involving hardware, of course, the processing time needs to be smaller (preferably quite smaller) than the sample time. Use the tools supplied by the hardware (arduino, dSPACE RTI, etc.) to find out the worst case execution time and then decide the proper sample time. Some system may report an "overrun" flag if execution time is longer than the sample time. The processing time could vary due to some processing being conditionally executed. So make sure to exercise the worst case processing.