Using the EventHandler Event Time Slot

One of the Newton 2.x OS Q&As
Copyright © 1997 Newton, Inc. All Rights Reserved. Newton, Newton Technology, Newton Works, the Newton, Inc. logo, the Newton Technology logo, the Light Bulb logo and MessagePad are trademarks of Newton, Inc. and may be registered in the U.S.A. and other countries. Windows is a registered trademark of Microsoft Corp. All other trademarks and company names are the intellectual property of their respective owners.


For the most recent version of the Q&As on the World Wide Web, check the URL: http://www.newton-inc.com/dev/techinfo/qa/qa.htm
If you've copied this file locally, click here to go to the main Newton Q&A page.
This document was exported on 7/23/97.


NEW: Using the EventHandler Event Time Slot (7/2/97)

Q: The Newton Programmer's Guide states that the 'time slot of the event frame passed to an endpoint's EventHandler is in ticks. After some experimentation, I've discovered that it is not in ticks. What is this time value?

A: The time value is actually the number of milliseconds since the Newton device was last reset. The Newton Programmer's Guide incorrectly states that it is the number of ticks since the unit was last reset. Note that because the unit of time is milliseconds, you can exceed NewtonScript's integer representation fairly quickly.

When you do run out of bits of precision for the millisecond value, the number will wrap to the smallest representable integer in NewtonScript. According to two's complement binary representation, that number is 0x3FFFFFFF, or -536870912 decimal. Therefore, the time value will start counting at zero, count up to 536870911, wrap to -536870912 then start to count back up to 536870911.