Really great C code. However, "timeInMilliseconds" should really use clock_gettime(CLOCK_MONOTIC, ..) instead of gettim
eofday(..). A sudden change in time due to NTP, administrator, timezone, etc, could have the loop in "dictRehashMilliseconds" running for longer than expected.
https://github.com/antirez/redis/blob/unstable/src/dict.h
https://github.com/antirez/redis/blob/unstable/src/dict.c
As you can see no rocket science there.