Forum Index
Sleep issues

 
Author Message
pjc30943



Joined: 02 Dec 2005

Posted: 05 February 2008, 4:57 AM    Post subject: Sleep issues

Anyone else experience problems with calling sleep with longer time lengths?

For example, sleep 500.0 will cause a delay much shorter than 500s.

Is there an upper limit?
Back to top
mikep



Joined: 24 Sep 2005
Location: Austin, TX

Posted: 05 February 2008, 5:28 AM    Post subject: Re: Sleep issues

pjc30943 wrote:
For example, sleep 500.0 will cause a delay much shorter than 500s.

Is there an upper limit?

Yes. If you look at sleep() it takes an unsigned integer - 16 bits. Each tick is 1/512 of a second. Therefore the maximum sleep time is 65536/512 = 128 seconds.
Back to top
pjc30943



Joined: 02 Dec 2005

Posted: 05 February 2008, 5:51 AM    Post subject: Re: Sleep issues

mikep wrote:

Yes. If you look at sleep() it takes an unsigned integer - 16 bits. Each tick is 1/512 of a second. Therefore the maximum sleep time is 65536/512 = 128 seconds.


Ah. Of course... Thank you.
Back to top
Display posts from previous:   
Page 1 of 1

 



ZBasic Microcontrollers Home
All content Copyright © 2005, 2006, 2007, 2008, 2009, 2010 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group