An accurate python sleep function
问题 I've tried time.sleep(), but its accuracy is total garbage. Consider this loop, for instance: for i in range(10000000): print(i) sleep(.334) Watch the numbers it prints. If it's anything like my computer, it's not even remotely regular. Is this function supposed to be accurate? Have I found a bug somewhere in my system? If this function is not supposed to be accurate, what function would be more accurate? 回答1: If you're just looking at the output, buffering might make it appear slightly