[mercury-users] SEC: UNCLASSIFIED:-
Fergus Henderson
fjh at cs.mu.OZ.AU
Tue Oct 29 13:29:59 AEDT 2002
On 29-Oct-2002, Ian.Sykes at defence.gov.au <Ian.Sykes at defence.gov.au> wrote:
> I want to port some turbo prolog code to Mercury.
>
> The code was written on a DOS 6/i386 system to do real-time control (don't
> panic - it's non-commercial general interest stuff) .
>
> The code requires elapsed time, so the ElapsedRealTime part of
> 'time__times(ProcessorTime,ElapsedRealTime,IO_state,IO_state)'
> appears ideal.
>
> Can those in the know confirm that ElapsedRealTime delivers genuine
> centiseconds as opposed to an in interpolation
> of some larger clock interval, as was the case with the DOS/386 platform.
The accuracy of Mercury's time__times procedure is determined by
the accuracy of the C function times() which is used to implement it.
The ElapsedRealTime returns a value in "clock ticks".
These are not guaranteed to be centiseconds.
I think that on some systems, the granularity of the timer may be more
than one "clock tick".
> Is there a better way of getting a more precise time interval?
Probably, but it depends on which platform you're using.
Which platform are you using? I take it you're not still
running this on a DOS 6 system? ;-)
On most platforms, there are C library functions for this sort of thing
which you can access from Mercury using the C interface.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post: mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the users
mailing list