A method for time synchronizing one or more devices in an automation environment using a first device, the one or more devices being connected through a control network, wherein the first device comprises information of a topology of the control network, the method comprising: selecting, by the first device, a second device in the control network, based on the information of the topology of the control network; sending, by the first device, a set of packets to the second device and receiving, by the first device, a set of delay requests corresponding to the first set of respective packets, wherein each packet of the set of packets includes a timestamp of the sending time at the first device, and wherein each delay request of the set of delay requests includes a timestamp of the sending time at the second device; sending, by the first device, a set of delay responses to the second device corresponding to the set of respective delay requests, wherein each delay response of the set of delay responses includes a timestamp; determining, by the second device, a set of forward times and a set of backward times, based on the set of packets and the set of delay responses, respectively, wherein a forward time of the set of forward times is determined based on the timestamp of a first packet from the first device, and a time of receipt of the first packet at the second device, and wherein a backward time of the set of backward times is determined based on the timestamp of the corresponding delay request from the second device, and a time of receipt of the corresponding delay request at the first device; determining, by the second device, a first minimum forward time from the first set of forward times and a first minimum backward time from the first set of backward times; determining, by the second device, a first correction factor from the first minimum forward time and the first minimum backward time, corresponding to a first instance of time synchronization; and applying, by the second device, the first correction factor to a clock provided at the second device and storing the first correction factor at the first device. selecting, by the first device, a second device in the control network, based on the information of the topology of the control network; sending, by the first device, a set of packets to the second device and receiving, by the first device, a set of delay requests corresponding to the first set of respective packets, wherein each packet of the set of packets includes a timestamp of the sending time at the first device, and wherein each delay request of the set of delay requests includes a timestamp of the sending time at the second device; sending, by the first device, a set of delay responses to the second device corresponding to the set of respective delay requests, wherein each delay response of the set of delay responses includes a timestamp; determining, by the second device, a set of forward times and a set of backward times, based on the set of packets and the set of delay responses, respectively, wherein a forward time of the set of forward times is determined based on the timestamp of a first packet from the first device, and a time of receipt of the first packet at the second device, and wherein a backward time of the set of backward times is determined based on the timestamp of the corresponding delay request from the second device, and a time of receipt of the corresponding delay request at the first device; determining, by the second device, a first minimum forward time from the first set of forward times and a first minimum backward time from the first set of backward times; determining, by the second device, a first correction factor from the first minimum forward time and the first minimum backward time, corresponding to a first instance of time synchronization; and applying, by the second device, the first correction factor to a clock provided at the second device and storing the first correction factor at the first device.