A discrete-time control method is presented for real-time energy management of DC microgrids, where each distributed controller only shares information with its neighbors. Controllers aim to achieve economic dispatch and voltage restoration while maintaining the generator outputs and line currents in their allowable ranges. The proposed control method is developed based on a primal–dual algorithm (PDA) to determine the optimal control variables, in which uncoordinated step-sizes and an adaptive mechanism are introduced to accelerate the algorithm. The convergence analysis is also provided. Finally, numerical tests show the high convergence rate of the algorithm, and the hardware experiments demonstrate the applicability of the proposed control method for real-time energy management.