You changed sampling time from 0.01 to 0.001 in the Gazebo Simulink block, which is correct. Currently, this is the way to change sample time.
I think, your concern is more about why Gazebo-Simulink runs slower after changing sample time.
If so, then the sample time is related to simulation step size. If you keep sample time equal to to 0.01 then each simulation step is of 10 msec. While, 0.001 sample time means each simulation step is of 1 msec. Thus, to finish 1 sec simulation with sample time of 0.001 will take longer time ( 1000 steps) than 0.01 ( 100 steps).
Further, the Gazebo Co-Simulation provides synchronized behavior between Gazebo and Simulink blocks. To maintian synchronization, Simulation is carried-out with step-by-step approach, which further add overhead and slow down simulation.