Jump to content
Korean Random
Sign in to follow this  
webium

How to stop threading.Timer ?

Recommended Posts

Hello, I'm trying to call a function every x seconds

import BigWorld
import threading
import time

def myCheck():
    # my code is here ...
    # call myCheck() again in 60 seconds
    threading.Timer(60, myCheck).start()

# start calling myCheck now and every 60 sec thereafter
myCheck()

The code is working, but after closing the client, there is still running process WorldOfTanks.exe

 

Is there a way to stop the timer when closing client?

Share this post


Link to post

Short link
Share on other sites

 

@webium,

BigWorld.callback(60, myCheck)

 

def NotificationTimer():

    if preventNotificationTimerCall != True:

        Create_sys_msg()

    threading.Timer(60, NotificationTimer).start()

 

Call "BigWorld.callback(60, NotificationTimer)" at which event?

Share this post


Link to post

Short link
Share on other sites

@Purzel,

def NotificationTimer():
    if preventNotificationTimerCall != True:
        Create_sys_msg()

BigWorld.callback(60, NotificationTimer)
Edited by Kotyarko_O
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

 

@Purzel,

def NotificationTimer():
    if preventNotificationTimerCall != True:
        Create_sys_msg()

BigWorld.callback(60, NotificationTimer)

Thx ... 

Share this post


Link to post

Short link
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...