TrueTime.swift
TrueTime.swift copied to clipboard
TrueTimeClient.sharedInstance.referenceTime?.now() returns date with millisecond precision
I noticed that TrueTimeClient.sharedInstance.referenceTime?.now() returns date with millisecond precision while system call Date() returns date with microsecond precision.
This behavior can be verified in following way:
print(TrueTimeClient.sharedInstance.referenceTime!.now().timeIntervalSince1970) // Prints 1492622263.091
print(Date().timeIntervalSince1970) // Prints 1492622263.12779
Such loose in precision can be harmful for tasks which depend on timestamp accuracy.
@Visput: Good point. NTP doesn't support this level of precision but we can update the data types used internally to at least maintain what is returned by the initial system calls.