Fixed particles moving at weird intervals by using time.h