How the rospy.sleep and how the rospy.Rate() works

Please check the following post and let me know if it helps.