In wireless body area networks (WBAN), energy efficiency is one of the most important issues to be addressed. In this paper, researches on efficiency optimization in WBAN are carried out. Based on the quality of service (QoS) required from each sensor node, intelligent time and power resource allocation is performed for energy saving. First, global energy minimization (GEM) model is proposed as a general target for optimization. Due to the special requirements of typical WBAN applications (e.g. health monitoring), network lifetime is defined and then handled as the objective function to be maximized. Both problems are proved to be geometric programming, which can be solved by many off the shelf solvers efficiently. Numeric results show that, compared to the sub-optimal resource allocation schemes, the proposed methods are able to improve the energy efficiency obviously. Furthermore, they also provide a performance benchmark for developing low complexity distributed algorithms in the future.