Time Synchronization in WSNs: A Maximum-value-based Consensus Approach