The mode change will take say a microsecond (probably less, I haven't tested). The GPIO level will change more slowly as the voltage at the GPIO changes. It takes time for the current to leak away. I'd have thought microseconds rather than milliseconds though. I expect there is more capacitance in y...