Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2015-03

fpGetTimeOfDay

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mark Morgan Lloyd

Are there any known issues with this sort of thing fpGetTimeOfDay (@TimeVal, nil) on various platforms? FPC 2.6.4 and 2.7.1 seem to be OK on x86, but on x64 (and FWIW SPARC, haven't tested others) it appears to be returning a fixed TimeVal plus a result of zero even if there are several seconds between calls.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]
Marco van de Voort
to Mark Morgan Lloyd

In our previous episode, Mark Morgan Lloyd said:

Show quoted text 5 lines
Are there any known issues with this sort of thing fpGetTimeOfDay (@TimeVal, nil) on various platforms? FPC 2.6.4 and 2.7.1 seem to be OK on x86, but on x64 (and FWIW SPARC, haven't tested others) it appears to be returning a fixed TimeVal plus a result of zero even if there are several seconds between calls.

My FreeBSD manpage says:

... If tp or tzp is NULL, the associated time
information will not be returned or set.

The Linux manpage words it differently:

If either tv or tz is NULL, the corresponding structure is not set or returned. (However, compilation warnings will result if tv is NULL.)

Henry Vermaak
to Marco van de Voort
Marco van de Voort wrote 16 lines
In our previous episode, Mark Morgan Lloyd said: > Are there any known issues with this sort of thing fpGetTimeOfDay > (@TimeVal, nil) on various platforms? FPC 2.6.4 and 2.7.1 seem to be OK > on x86, but on x64 (and FWIW SPARC, haven't tested others) it appears to > be returning a fixed TimeVal plus a result of zero even if there are > several seconds between calls. My FreeBSD manpage says: ... If tp or tzp is NULL, the associated time information will not be returned or set. The Linux manpage words it differently: If either tv or tz is NULL, the corresponding structure is not set or returned. (However, compilation warnings will result if tv is NULL.)

Well that's obvious, you can't dereference a NULL so there's nothing to set. The tz parameter is obsolete, it should normally be NULL.

Henry

Mark Morgan Lloyd
to Marco van de Voort: In our previous episode, Mark Morgan Lloyd said: My FreeBSD manpage says: ... If tp or…
Marco van de Voort wrote 16 lines
In our previous episode, Mark Morgan Lloyd said: > Are there any known issues with this sort of thing fpGetTimeOfDay > (@TimeVal, nil) on various platforms? FPC 2.6.4 and 2.7.1 seem to be OK > on x86, but on x64 (and FWIW SPARC, haven't tested others) it appears to > be returning a fixed TimeVal plus a result of zero even if there are > several seconds between calls. My FreeBSD manpage says: ... If tp or tzp is NULL, the associated time information will not be returned or set. The Linux manpage words it differently: If either tv or tz is NULL, the corresponding structure is not set or returned. (However, compilation warnings will result if tv is NULL.)

The funny thing is that the snippet of code that I'm using was contributed by you, and that it works fine on multiple versions of x86 kernel.

http://lists.freepascal.org/pipermail/fpc-pascal/2007-February/013356.html

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]
Marco van de Voort
to Mark Morgan Lloyd

In our previous episode, Mark Morgan Lloyd said:

Show quoted text 8 lines
> If either tv or tz is NULL, the corresponding structure is not set or > returned. (However, compilation warnings will result if tv is NULL.) The funny thing is that the snippet of code that I'm using was contributed by you, and that it works fine on multiple versions of x86 kernel. http://lists.freepascal.org/pipermail/fpc-pascal/2007-February/013356.html

Yes, I read wrong. Only the corresponding structure is not updated apparently, not both.