how to call a function for evry 10 secs

Ulrich Eckhardt ulrich.eckhardt at dominolaser.com
Thu Jun 30 04:37:34 EDT 2011


Dennis Lee Bieber wrote:
> But if the function itself runs for longer than 10 seconds, there
> will be a major problem, as the sleep apparently takes the argument as
> unsigned, and a negative number is a very big sleep!

"time.sleep()" takes a floating point number, so an underflow like for 
fixed-size integers in C shouldn't happen. What puzzles me here is your use 
of "apparently", because here a negative value actually raises an "IOError: 
[Errno 22] Invalid argument" when I call "sleep(-1)".

The system I'm on is a Debian GNU/Linux system running on some x86 hardware, 
for the record, and I'm using Python 2.6.6.

Uli

-- 
Domino Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932




More information about the Python-list mailing list