he wasn't using KM to the fullest in the beginning, which is normal considering he pretty much just got it.
when he was trying to pass by the Raikage his speed was around the Raikage's (maybe a bit less) and if that was KM max speed he would have been hit, but Raikage pretty much forced him to fast learn or he would die.