Hi, I think that maybe the accuracy of the run_with_period function https://github.com/redis/redis/blob/unstable/src/server.h#L650 can be improved. In the current situation, for example, with server.hz equal to 10, any value for _ms_ between 100 and 199 would produce true for the if condition, hence the part controlled by the condition is run in every iteration in the cronloop (scheduled every 100ms). However, if _ms_ is close to 200, it is not quire proper to shedule it like this.

A more accurate way to implement it is to change the condition in the if statement to server.cronloop*(1000/server.hz)/_ms_ > (server.cronloop-1)*(1000/server.hz)/_ms_ which is to test whether the scheduled time is in the latest interval in the cronloop. One thing to concern though is that server.cronloop*(1000/server.hz) may exceed the integer range, so maybe cast it to long long or change the type of server.cronloop to long long.