python 定时器(timer)
            2018-10-12            python             1872         
                #! /usr/bin/python3
#! -*- conding: utf-8 -*-
import threading
import time
def fun_timer():
    print(time.strftime('%Y-%m-%d %H:%M:%S'))
    global timer
    timer = threading.Timer(2,fun_timer)
    timer.start();
timer = threading.Timer(1,fun_timer)
timer.start();
time.sleep(15)
timer.cancel()         很赞哦! (0)
                                                         相关文章
文章评论
- 
- 
- 
                                        0条评论                                    
                 
         
              