Wireless sensor networks are envisioned by linking existing and emerging technologies of computers, wireless radio communications systems and sophisticated sensors to be used in application. Simulation is an important way to validate algorithm or protocol in wireless sensor networks. First we describe some typical simulation methods in WSN. Then we present a new simulation tool named Truetime and introduce key steps of WSN frame construction and node models creation and function code written. Finally, we illuminate the simulation method by an example of route research. The results show that Truetime provides a novel tool for simulating wireless sensor networks.