Because the clock accuracy and precision requirements are often stricter in sensor networks than in traditional distributed systems,the algorithm of time synchronization in traditional networks can not be used in wireless sensor networks.This paper makes research on the algorithm of time synchronization based on CSMA-CA on the NS2 platform,simulates particularly on beacon-enabled network,and analyses the results to make some conclusions,including the comparison between beacon-enabled network and non-beacon network.