Simple question: Why are the intervals inconsistent?
(This is just a basic test to indicate 3.000 second intervals, yet running on the cmd prompt shows variations between 3.001 to 3.020. On a 2.2 ghz processor, this delay seems unreasonable. What am I missing?)
import time
import random
from graphics import *
def main():
print("Press Enter to start & CTRL+C to exit.")
while True:
try:
start=time.time()
time.sleep(3.000)
interval=time.time()
print("Total time:", round(abs(interval-start),3),"second interval")
except KeyboardInterrupt:
break
main()