sched() function questions

C

Chris Hare

I am currently using threading.timer to execute an event in my big chunk of code. This is causing a problem with sqlite, so I am trying to figure out the sched function

import sched
import time

def timerfunc():
print "hello", time.time()
return(time.time())

def delay(period):
time.sleep(period)

def some():
s.enterabs(900,1, timerfunc, () )
s.run()

s = sched.scheduler(timerfunc, delay)

print time.time()
some()
x = 0
while 1:
print x
x = x + 1
time.sleep(60)
print str(s.queue())

What I am trying to do is mimic the Timer function, where my code will continue to function while my scheduled function executes in 15 minutes or 900 seconds. This doesn't do it though. Any help?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top