Re: [fpc-pascal] Efficient millisecond timestamp

2014-01-11 Thread Michael Van Canneyt
On Sat, 11 Jan 2014, Graeme Geldenhuys wrote: On 2014-01-10 11:02, Michael Van Canneyt wrote: Last time I looked, EpikTimer used Now() on Unixes, definitely if you were not on intel platforms. On i386 systems it uses Intel CPU hardware timers. On other Windows systems it uses the Windows

Re: [fpc-pascal] Efficient millisecond timestamp

2014-01-11 Thread Graeme Geldenhuys
On 2014-01-10 11:02, Michael Van Canneyt wrote: > > Last time I looked, EpikTimer used Now() on Unixes, > definitely if you were not on intel platforms. On i386 systems it uses Intel CPU hardware timers. On other Windows systems it uses the Windows QueryPerformanceCounter API. On Unixes it use

Re: [fpc-pascal] Efficient millisecond timestamp

2014-01-10 Thread Mark Morgan Lloyd
Michael Van Canneyt wrote: On Fri, 10 Jan 2014, Mark Morgan Lloyd wrote: Michael Van Canneyt wrote: And I hardly see the point of converting something coming from the hardware and/or a kernel counter to a double and then back to a quadword. Nevertheless, Now() is the only portable construc

Re: [fpc-pascal] Efficient millisecond timestamp

2014-01-10 Thread Mark Morgan Lloyd
Michael Schnell wrote: On 01/10/2014 09:56 AM, Mark Morgan Lloyd wrote: What's the most efficient and portable way of getting a millisecond timestamp. Do you run some "realtime" OS ? Otherwise millisecond timestamp don't make much sense, as the OS might delay you application for a second now

Re: [fpc-pascal] Efficient millisecond timestamp

2014-01-10 Thread Michael Van Canneyt
On Fri, 10 Jan 2014, Mark Morgan Lloyd wrote: Michael Van Canneyt wrote: And I hardly see the point of converting something coming from the hardware and/or a kernel counter to a double and then back to a quadword. Nevertheless, Now() is the only portable construct available. Multiply it w

Re: [fpc-pascal] Efficient millisecond timestamp

2014-01-10 Thread Mark Morgan Lloyd
Michael Van Canneyt wrote: And I hardly see the point of converting something coming from the hardware and/or a kernel counter to a double and then back to a quadword. Nevertheless, Now() is the only portable construct available. Multiply it with msecsperday and round to int64 if you need an

Re: [fpc-pascal] Efficient millisecond timestamp

2014-01-10 Thread Michael Schnell
On 01/10/2014 09:56 AM, Mark Morgan Lloyd wrote: What's the most efficient and portable way of getting a millisecond timestamp. Do you run some "realtime" OS ? Otherwise millisecond timestamp don't make much sense, as the OS might delay you application for a second now and then. -Michael __

Re: [fpc-pascal] Efficient millisecond timestamp

2014-01-10 Thread Michael Van Canneyt
On Fri, 10 Jan 2014, Mark Morgan Lloyd wrote: Michael Van Canneyt wrote: On Fri, 10 Jan 2014, Mark Morgan Lloyd wrote: What's the most efficient and portable way of getting a millisecond timestamp, relative to any ancient epoch? I find TimeStampToMSecs(DateTimeToTimeStamp(Now)) hard to s

Re: [fpc-pascal] Efficient millisecond timestamp

2014-01-10 Thread Mark Morgan Lloyd
Michael Van Canneyt wrote: On Fri, 10 Jan 2014, Mark Morgan Lloyd wrote: What's the most efficient and portable way of getting a millisecond timestamp, relative to any ancient epoch? I find TimeStampToMSecs(DateTimeToTimeStamp(Now)) hard to swallow since Now() is hardly efficient and the res

Re: [fpc-pascal] Efficient millisecond timestamp

2014-01-10 Thread Tomas Hajny
On Fri, January 10, 2014 10:01, Michael Van Canneyt wrote: > On Fri, 10 Jan 2014, Mark Morgan Lloyd wrote: > >> What's the most efficient and portable way of getting a millisecond >> timestamp, relative to any ancient epoch? I find >> >> TimeStampToMSecs(DateTimeToTimeStamp(Now)) >> >> hard to swal

Re: [fpc-pascal] Efficient millisecond timestamp

2014-01-10 Thread Michael Van Canneyt
On Fri, 10 Jan 2014, Mark Morgan Lloyd wrote: What's the most efficient and portable way of getting a millisecond timestamp, relative to any ancient epoch? I find TimeStampToMSecs(DateTimeToTimeStamp(Now)) hard to swallow since Now() is hardly efficient and the resulting Comp is marked as

[fpc-pascal] Efficient millisecond timestamp

2014-01-10 Thread Mark Morgan Lloyd
What's the most efficient and portable way of getting a millisecond timestamp, relative to any ancient epoch? I find TimeStampToMSecs(DateTimeToTimeStamp(Now)) hard to swallow since Now() is hardly efficient and the resulting Comp is marked as non-potable in the documentation. -- Mark Morgan