This paper studies the wireless sensor networks (WSN) application scenario with periodical traffic from all sensors to a sink. We present a time-optimum and energy-efficient packet scheduling algorithm and its distributed implementation. We first give a general many-to-one packet scheduling algorithm for wireless networks, and then prove that it is time-optimum and costs [image omitted], N(u0)-1) time slots, assuming each node reports one unit of data in each round. Here [image omitted] is the total number of sensors, while [image omitted] denotes the number of sensors in a sink's largest branch subtree. With a few adjustments, we then show that our algorithm also achieves time-optimum scheduling in heterogeneous scenarios, where each sensor reports a heterogeneous amount of data in each round. Then we give a distributed implementation to let each node calculate its duty-cycle locally and maximize efficiency globally. In this packet-scheduling algorithm, each node goes to sleep whenever it is not transceiving, so that the energy waste of idle listening is also mitigated. Finally, simulations are conducted to evaluate network performance using the Qualnet simulator. Among other contributions, our study also identifies the maximum reporting frequency that a deployed sensor network can handle.