Time Resolution
Seth Kurtzberg
seth at cql.com
Tue Feb 1 21:34:41 EST 2005
Ashley Yakeley wrote:
[snip]
>Can we assume that the system clock will be set to UTC?
>
No, you can't assume it. But I believe you can assume that the calls to
obtain the time are smart enough to convert it to UTC if necessary.
>This is
>apparently in the POSIX standard. What about on Windows platforms? If
>so, the system clock should return POSIX time.
>
>
I would want to verify that windows behaves correctly, rather than
assume it. Microsoft is not a big POSIX fan.
>Do we want the same resolution in all three? Should it be fixed or
>platform-dependent? Bear in mind that there are applications for this
>that may not involve the system clock at all.
>
>
>
Since clearly the library cannot _allways_ know the precision, one can
make a good case that the responsibility for determining the precision
is the library user, not the library itself. And/or, you can isolate
the platform-dependent aspects and allow the user to set them, or have
the library try to determine the correct values and allow the user to
override the values. Which implies that the user can get the values in
the first place.
More information about the Libraries
mailing list