Magic function time.sleep

when you are developing an multithread based program, if you got cpu 100% usage, try use time.sleep(0.01) . you will find that the cpu consume rate decrease to an better value..
it is a tip i got during i debug socket server project based on python ’s module asyncore recently.
another tip is ensure delete .pyc file after you move some file to an new place. otherwise, some error will be hidden because they are always importing an non-exist file. but since .pyc file exist, so no error raised.

Leave a comment


Leave a Reply

[ Ctrl + Enter ]

click to change验证码