Bacteria within communities can interact to organize their behavior. It has been unclear whether such interactions can extend beyond a single community to coordinate the behavior of distant populations. We discovered that two Bacillus subtilis biofilm communities undergoing metabolic oscillations can become coupled through electrical signaling and synchronize their growth dynamics. Coupling increases competition by also synchronizing demand for limited nutrients. As predicted by mathematical modeling, we confirm that biofilms resolve this conflict by switching from in-phase to antiphase oscillations. This results in time-sharing behavior, where each community takes turns consuming nutrients. Time-sharing enables biofilms to counterintuitively increase growth under reduced nutrient supply. Distant biofilms can thus coordinate their behavior to resolve nutrient competition through time-sharing, a strategy used in engineered systems to allocate limited resources.