Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

segmentio/gevent-timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gevent-timer

pip install gevent_timer

related:

usage

import gevent_timer as timer

def do():
  print("hi")

# execute do() every 100 seconds
interval = timer.set_interval(do, 100)

# stop after 305 seconds
timeout = timer.set_timeout(lambda: timer.clear_interval(interval), 305)

# nah, scratch that. let's keep running do()
timer.clear_timeout(timeout)