Global and Logical Time in Distributed Algorithms