Panda3D

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Timer Class Reference
Inheritance diagram for Timer:

## Public Member Functions
| __init__ (self, interval, function, args=[], kwargs={})
| cancel (self)
| run (self)
Public Member Functions inherited from Thread
| __init__ (self, group=None, target=None, name=None, args=(), kwargs={}, daemon=None)
| __del__ (self)
| is_alive (self)
| join (self, timeout=None)
| setName (self, name)
| start (self)
Public Member Functions inherited from ThreadBase
| __init__ (self)
| __setattr__ (self, key, value)
| getName (self)
| isDaemon (self)
| setDaemon (self, daemon)

## Public Attributes
| args = args
| finished = Event()
| function = function
| interval = interval
| kwargs = kwargs
Public Attributes inherited from Thread
| ident = None

## Additional Inherited Members
Static Public Attributes inherited from Thread
| isAlive = is_alive
Static Public Attributes inherited from ThreadBase
| considerYield
| forceYield

## Detailed Description

    Call a function after a specified number of seconds:

    t = Timer(30.0, f, args=[], kwargs={})
    t.start()
    t.cancel() # stop the timer's action if it's still waiting

## Constructor & Destructor Documentation

## ◆ __init__()

__init__ | ( |  | self,
|  |  | interval,
|  |  | function,
|  |  | args = [],
|  |  | kwargs = {} )

## Member Function Documentation

## ◆ cancel()

cancel | ( |  | self | ) |

    Stop the timer if it hasn't finished yet

## ◆ run()

run | ( |  | self | ) |

Reimplemented from Thread.

## Member Data Documentation

## ◆ args

args = args

## ◆ finished

finished = Event()

## ◆ function

function = function

## ◆ interval

interval = interval

## ◆ kwargs

kwargs = kwargs