setTimeOut . , , startTime , .
Btw. I assume that a delay of 500 ms is used in work around small deviations in hours. You want to update the value of an element every second. To do this, it is better to calculate the time until the next whole second and set this as a delay. This will give you a more accurate watch.
source
share