pynetdicom.timer.Timer

class pynetdicom.timer.Timer(max_number_seconds)[source][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.

References

  • DICOM Standard, Part 8, Section 9.1.5.

__init__(max_number_seconds)[source][source]

Create a new Timer.

Parameters

max_number_seconds (int or float or None) – The number of seconds before the timer expires. A value of None means no timeout.

Methods

__init__(max_number_seconds)

Create a new Timer.

restart()

Restart the timer.

start()

Resets and starts the timer running.

stop()

Stops the timer and resets it.

Attributes

is_expired

Check if the timer has expired.

time_remaining

Return the number of seconds remaining until timeout.

timeout_seconds

Return the number of seconds set for timeout.