Re: Re: Re: NSTimer: serious drift in Time (in milliseconds)
Re: Re: Re: NSTimer: serious drift in Time (in milliseconds)
- Subject: Re: Re: Re: NSTimer: serious drift in Time (in milliseconds)
- From: "Shawn Erickson" <email@hidden>
- Date: Fri, 10 Nov 2006 16:04:05 -0800
On 11/10/06, Shawn Erickson <email@hidden> wrote:
2006-11-10 15:45:45.002 Test[28065] Timer fired, now = 2006-11-10
15:45:45 -0800, interval since start = -285001.006007 (ms)
2006-11-10 15:45:50.002 Test[28065] Timer fired, now = 2006-11-10
15:45:50 -0800, interval since start = -290001.056999 (ms)
2006-11-10 15:45:55.002 Test[28065] Timer fired, now = 2006-11-10
15:45:55 -0800, interval since start = -295001.055002 (ms)
2006-11-10 15:46:00.002 Test[28065] Timer fired, now = 2006-11-10
15:46:00 -0800, interval since start = -300000.863999 (ms)
2006-11-10 15:46:05.002 Test[28065] Timer fired, now = 2006-11-10
15:46:05 -0800, interval since start = -305001.053989 (ms)
2006-11-10 15:46:10.002 Test[28065] Timer fired, now = 2006-11-10
15:46:10 -0800, interval since start = -310000.988007 (ms)
2006-11-10 15:46:15.002 Test[28065] Timer fired, now = 2006-11-10
15:46:15 -0800, interval since start = -315001.174986 (ms)
As an FYI if you don't use the setFireDate: (or otherwise manually
schedule your timer) you can see the drift that result as of how
repeating timers are implemented. For example... (note the increasing
skew compared to the above).
2006-11-10 15:57:00.013 DialogExample[28151] Timer fired, now =
2006-11-10 15:57:00 -0800, interval since start = 10.066003 (ms),
count = 1
2006-11-10 15:57:05.012 DialogExample[28151] Timer fired, now =
2006-11-10 15:57:05 -0800, interval since start = 5011.195004 (ms),
count = 2
2006-11-10 15:57:10.012 DialogExample[28151] Timer fired, now =
2006-11-10 15:57:10 -0800, interval since start = 10011.711001 (ms),
count = 3
2006-11-10 15:57:15.013 DialogExample[28151] Timer fired, now =
2006-11-10 15:57:15 -0800, interval since start = 15012.634993 (ms),
count = 4
2006-11-10 15:57:20.014 DialogExample[28151] Timer fired, now =
2006-11-10 15:57:20 -0800, interval since start = 20013.711005 (ms),
count = 5
2006-11-10 15:57:25.015 DialogExample[28151] Timer fired, now =
2006-11-10 15:57:25 -0800, interval since start = 25014.723003 (ms),
count = 6
2006-11-10 15:57:30.016 DialogExample[28151] Timer fired, now =
2006-11-10 15:57:30 -0800, interval since start = 30015.430003 (ms),
count = 7
2006-11-10 15:57:35.017 DialogExample[28151] Timer fired, now =
2006-11-10 15:57:35 -0800, interval since start = 35016.553998 (ms),
count = 8
2006-11-10 15:57:40.018 DialogExample[28151] Timer fired, now =
2006-11-10 15:57:40 -0800, interval since start = 40017.174006 (ms),
count = 9
2006-11-10 15:57:45.018 DialogExample[28151] Timer fired, now =
2006-11-10 15:57:45 -0800, interval since start = 45017.740011 (ms),
count = 10
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden