Revision [107]

This is an old revision of ioMicroMSecs made by JohnMcIntosh on 2008-10-14 22:52:21.


sqInt ioMicroMSecs(void))

Parms: NONE
return: return milliseconds
From: Interpreter,others

returns millisecond clock value.

Return the ms clock time, or some ms counter.
May start from zero, may wrap (as a result of overflow, or a result of clock time reset)
We note the ms clock time does not need to sync with the ioSeconds
On older macintosh VMs the clock value would start from zero
This value may wrap, the wrap limit is likely hardware and operating system dependent.

Note ioLowResMSecs was depreciated, may still be in some api platform code. Historically there were three clocks on the macintosh ioLowResMSecs, ioMicroMSecs, ioMSecs which varied in accuracy, and expense. The VM and image may check the clock as much as 1000 a second (sillly)

ioLowResMSecs is used for some timer checking, and event polling, the ioLowResMSecs clock value is set every 16 ms via a timer thread.

ioMicroMSecs is calculated via some unix calls (gettimeofday) subtracted from startup time.
ioMSecs calls ioMicroMSecs


we and with & sMillisecondClockMask

unix calls gettimeofday) subtracted from startup time.
ioLowResMSecs is set via either the optional iTimer logic, or comes from ioMicroMSecs
ioMSecs calls ioMicroMSecs


Callers may not handle wrapping or at 2 billion milliseconds it could go negative
IN some places it does & with MillisecondClockMask.

Correct solution is to & with MillisecondClockMask at the point were the value is generated.

There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki