pynetdicom.timer.Timer¶
- 
class pynetdicom.timer.Timer(timeout)[source]¶
- A generic timer. - Implementation of the DICOM Upper Layer’s ARTIM timer. The ARTIM timer is used by the state machine to monitor connection and response timeouts. This class may also be used as a general purpose expiry timer. - A - timeoutof- Noneimplies that- expiredalways returns- Falseand- remainingalways returns- 1. A- timeoutof- floatimplies that:- If not yet started, - expiredreturns- Falseand- remainingreturns- timeout
- If started then - expiredreturns- Falseuntil the time since starting is greater than- timeoutafter which it returns- True.- remainingreturns the number of seconds until- expiredreturns- True(will return negative value after expiry)
- If started then stopped before the timeout then - expiredreturns- False, if stopped after the time since starting is greater than- timeoutthen returns- True.- remainingalways returns the number of seconds until- expiredreturns- True.
 - References - DICOM Standard, Part 8, Section 9.1.5. 
 - 
__init__(timeout)[source]¶
- Create a new - Timer.- Parameters
- timeout (numeric or None) – The number of seconds before the timer expires. A value of - Nonemeans the timer never expires.
 
 - Methods - __init__(timeout)- Create a new - Timer.- restart()- Restart the timer. - start()- Resets and starts the timer running. - stop()- Stops the timer and resets it. - Attributes - Check if the timer has expired. - Return the number of seconds remaining until timeout. - Return the number of seconds set for - timeout.- 
property expired¶
- Check if the timer has expired. - Returns
- Trueif the timer has expired,- Falseotherwise
- Return type
 
 - 
property remaining¶
- Return the number of seconds remaining until timeout. - Returns - 1if the timer is set to never expire.