how to set timer

pehr anderson pehr at pehr.net
Fri Sep 8 01:57:54 EDT 2000


Dear Ykchew, 

You probably want to use two calls: time.time() and time.sleep(seconds)

Here's what I think you might want...

	import time

	start = time.time()
	count = 0
	while 1:
		# your computation here

		count = count + 1
		time.sleep(time.time() + 10 * count - x)


ykchew wrote:
> 
> hi there,
>         i am developing a application that require to do some calculation in
> every 10 seconds.
>        so, how can i set the timer in python??



More information about the Python-list mailing list