Revision history for ioMicroMSecs
Additions:
See Unix
Additions:
See iPhone
Deletions:
Additions:
By default these are defined in sq.h as
sqInt ioMSecs(void);
/* deprecated out ofexistence sqInt ioLowResMSecs(void); */
sqInt ioMicroMSecs(void);
#define ioMSecs() ((1000 * clock()) / CLOCKS_PER_SEC)
/* this macro cannot be used now that ioMicroMSecs is involved in the
sqVirtualMachine structures - we must have a function
#define ioMicroMSecs() ((1000 * clock()) / CLOCKS_PER_SEC)
*/
sqInt ioMSecs(void);
/* deprecated out ofexistence sqInt ioLowResMSecs(void); */
sqInt ioMicroMSecs(void);
#define ioMSecs() ((1000 * clock()) / CLOCKS_PER_SEC)
/* this macro cannot be used now that ioMicroMSecs is involved in the
sqVirtualMachine structures - we must have a function
#define ioMicroMSecs() ((1000 * clock()) / CLOCKS_PER_SEC)
*/
Additions:
ioMSecs may call timeGetTime or GetTickCount
The timeGetTime function retrieves the system time, in milliseconds. The system time is the time elapsed since Windows was started. GetTickCount The return value is the number of milliseconds that have elapsed since the system was started.
Windows systems may only be accurate to 5 ms.
The timeGetTime function retrieves the system time, in milliseconds. The system time is the time elapsed since Windows was started. GetTickCount The return value is the number of milliseconds that have elapsed since the system was started.
Windows systems may only be accurate to 5 ms.
Additions:
**return**: return milliseconds via primitiveMillisecondClock
Deletions:
Additions:
we and with & MillisecondClockMask (1FFFFFFF)
& with 0x3FFFFFFF
WHY THIS VALUE VERSUS MillisecondClockMask?
Correct solution is to & with MillisecondClockMask at the point were the value is generated, versus relying on caller to & with correct value?
& with 0x3FFFFFFF
WHY THIS VALUE VERSUS MillisecondClockMask?
Correct solution is to & with MillisecondClockMask at the point were the value is generated, versus relying on caller to & with correct value?
Deletions:
Correct solution is to & with MillisecondClockMask at the point were the value is generated.
Additions:
From sq.h
The primary one, ioMSecs(), is used to implement Delay and Time
millisecondClockValue. The resolution of this clock
determines the resolution of these basic timing functions. For
doing real-time control of music and MIDI, a clock with resolution
down to one millisecond is preferred, but a coarser clock (say,
1/60th second) can be used in a pinch.
The function ioMicroMSecs() is used only to collect timing statistics
for the garbage collector and other VM facilities. (The function
name is meant to suggest that the function is based on a clock
with microsecond accuracy, even though the times it returns are
in units of milliseconds.) This clock must have enough precision to
provide accurate timings, and normally isn't called frequently
enough to slow down the VM. Thus, it can use a more expensive clock
than ioMSecs(). This function is listed in the sqVirtualMachine plugin
support mechanism and thus needs to be a real function, even if a macro is
use to point to it.
There was a third form that used to be used for quickly timing primitives in
order to try to keep millisecond delays up to date. That is no longer used.
The primary one, ioMSecs(), is used to implement Delay and Time
millisecondClockValue. The resolution of this clock
determines the resolution of these basic timing functions. For
doing real-time control of music and MIDI, a clock with resolution
down to one millisecond is preferred, but a coarser clock (say,
1/60th second) can be used in a pinch.
The function ioMicroMSecs() is used only to collect timing statistics
for the garbage collector and other VM facilities. (The function
name is meant to suggest that the function is based on a clock
with microsecond accuracy, even though the times it returns are
in units of milliseconds.) This clock must have enough precision to
provide accurate timings, and normally isn't called frequently
enough to slow down the VM. Thus, it can use a more expensive clock
than ioMSecs(). This function is listed in the sqVirtualMachine plugin
support mechanism and thus needs to be a real function, even if a macro is
use to point to it.
There was a third form that used to be used for quickly timing primitives in
order to try to keep millisecond delays up to date. That is no longer used.