openc2lib.types.data.duration
1class Duration(int): 2 """ OpenC2 Duration 3 4 A time (positive number) expressed in milliseconds (Sec. 3.4.2.3). 5 """ 6 def __init__(self, dur): 7 """ Initialization 8 9 Initialize to `dur` if greater or equal to zero, raise an exception if negative. 10 """ 11 if int(dur) < 0: 12 raise ValueError("Duration must be a positive number") 13 self=int(dur)
class
Duration(builtins.int):
3class Duration(int): 4 """ OpenC2 Duration 5 6 A time (positive number) expressed in milliseconds (Sec. 3.4.2.3). 7 """ 8 def __init__(self, dur): 9 """ Initialization 10 11 Initialize to `dur` if greater or equal to zero, raise an exception if negative. 12 """ 13 if int(dur) < 0: 14 raise ValueError("Duration must be a positive number") 15 self=int(dur)
OpenC2 Duration
A time (positive number) expressed in milliseconds (Sec. 3.4.2.3).
Duration(dur)
8 def __init__(self, dur): 9 """ Initialization 10 11 Initialize to `dur` if greater or equal to zero, raise an exception if negative. 12 """ 13 if int(dur) < 0: 14 raise ValueError("Duration must be a positive number") 15 self=int(dur)
Initialization
Initialize to dur if greater or equal to zero, raise an exception if negative.
Inherited Members
- builtins.int
- conjugate
- bit_length
- bit_count
- to_bytes
- from_bytes
- as_integer_ratio
- real
- imag
- numerator
- denominator