[PATCH V2] tick: Make sleep length calculation more accurate