It's an unusual idiom in which not only a gerund, but also words normally associated with it in other patterns are used together as if they were a noun.
It takes some time to get used to the new procedures.
It takes some time to get used to living in the country.