Duration#

class swordfish._swordfishcpp.Duration(data: str)#
class swordfish._swordfishcpp.Duration(val: int, unit: str = 'ns')

Represents a Swordfish Duration object.

Parameters:
  • data (str) – A Python str used to initialize the Duration object.

  • val (int) – The value of the Duration.

  • unit (str, optional) – The unit of the Duration. Defaults to “ns”.

Examples

>>> import swordfish as sf
>>> sf.data.Duration("20w")
Duration(20w)
>>> sf.data.Duration(3, "m")
Duration(3m)
>>> sf.data.Duration(10)
Duration(10ns)
NULL_VALUE: Duration#