EXPAND ALL
  • Home

px.parse_duration

Parse a duration string to a duration in nanoseconds.

Parse a duration string ("-5m") to integer nanoseconds (-3,000,000,000) while preserving the sign from the string.

Arguments

NameTypeDescription
durationstringThe duration in string form.

Returns

px.Duration: The duration in nanoseconds.

Examples

# duration = -300000000000
duration = px.parse_duration("-5m")
# duration = 300000000000
duration = px.parse_duration("5m")

This site uses cookies to provide you with a better user experience. By using Pixie, you consent to our use of cookies.