OT van Winkle
OT van Winkle
- Subject: OT van Winkle
- From: Peter Lovell <email@hidden>
- Date: Wed, 22 May 2002 16:42:36 -0400
I have an interesting OT puzzle which might also hit some other folks.
We have a Carbon app which runs on both 9 and X. It needs to check time
from within notifiers, so we use OTGetClockTimeInSecs. Unfortunately
these behave differently, and more differently than we anticipated.
OpenTransport.h says that OTGetClockTimeInSecs returns time since OT was
initialized, as UInt32.
On OS 9 (9.2.2, CarbonLib 1.5), it seems to return time since 1/1/1904
rather than time since OT started.
When we run on OS X (10.1.4) it seems to return time since boot, but ONLY
the machine has been awake. So any period spent sleeping is NOT counted.
For example, I ran our app and OTGetClockTimeInSecs was 6079. I then put
the PowerBook to sleep for 45 minutes, woke it up and re-ran the app. The
time had advanced only to 6190, less than 2 minutes increment. Ouch.
Does anyone have any suggestion for a way of measuring elapsed time which...
1. is safe for use in OT notifier code
2. works on OS 9
3. works on OS X
Resolution is seconds is sufficient, with a maximum time of twelve hours
or so.
Thanks.....Peter
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.