か~ないかのうちに

ka~nai ka no uchi ni just as; right after; as soon as