sandra@utah-cs.UUCP (02/21/87)
Is there a recommended way to get a time value with a higher resolution than 2 seconds, as returned by Tgettime()? Ideally, I would like something with a resolution on the order of a centisecond or so. This would be used for timing some benchmark programs and the like. -Sandra Loosemore sandra@utah-cs
bammi@cwruecmp.UUCP (02/22/87)
In article <4313@utah-cs.UUCP> sandra@utah-cs.UUCP (Sandra J Loosemore) writes: >Is there a recommended way to get a time value with a higher resolution >than 2 seconds, as returned by Tgettime()? Ideally, I would like something The preferred way is to use the Xbtimer() Xbios call, using timer A, which is explicitly reserved for user applications. If you just want to measure the time interval, the easier way is to read the value of the 200Hz system timer by reading the LONG at location 0x000004BA. Remember to do it in supervisor mode, or else you'll get bombs. If you need examples of the use of either of the two techniques just send mail. -- usenet: {decvax|cbatt|cbosgd}!cwruecmp!bammi jwahar r. bammi csnet: bammi@case arpa: bammi%case@csnet-relay compuServe: 71515,155
sansom@trwrb.UUCP (02/22/87)
In article <4313@utah-cs.UUCP> sandra@utah-cs.UUCP (Sandra J Loosemore) writes: >Is there a recommended way to get a time value with a higher resolution >than 2 seconds, as returned by Tgettime()? The easiest way is to get the value of the system 200 hz clock at location $04ba. It's in a "protected" part of memory, so you'll have to access it in supervisor mode. If you need any more help, let me know and I'll send you a simple routine which returns the current value. -Rich -- __________ ______ ____ _____ ___ /_________//___ ||__|/____|/__/ Richard E. Sansom ___ ____/ / ____________ TRW Electronics & Defense Sector / / / /\ < | /| / One Space Park Drive, R3/1028 / / / / \ \ | / | / Redondo Beach, CA 90278 /__/ /__/ \__\|__/ |__/ ...{decvax,ucbvax,ihnp4}!trwrb!sansom
dyer@atari.UUCP (02/22/87)
> Is there a recommended way to get a time value with a higher resolution > than 2 seconds, as returned by Tgettime()? The system variable '_hz_200' is incremented (surprise!) two hundred times a second. It a longword at 0x4ba. Finer resolution timers can be obtained by setting up 68901 timer A at whatever frequency you like and handling the interrupt. -- -Landon Dyer, Atari Corp. {sun,lll-lcc,imagen}!atari!dyer The views expressed here do not not necessarily reflect those of Atari Corp. Segments are for worms.