github.com/GuanceCloud/cliutils@v1.1.21/pipeline/ptinput/funcs/md/duration_precision.en.md (about)

     1  ### `duration_precision()` {#fn-duration-precision}
     2  
     3  Function prototype: `fn duration_precision(key, old_precision: str, new_precision: str)`
     4  
     5  Function description: Perform duration precision conversion, and specify the current precision and target precision through Function parameters:. Support conversion between s, ms, us, ns.
     6  
     7  Example:
     8  
     9  ```python
    10  # in << {"ts":12345}
    11  json(_, ts)
    12  cast(ts, "int")
    13  duration_precision(ts, "ms", "ns")
    14  
    15  # Extracted data(drop: false, cost: 33.279µs):
    16  # {
    17  #   "message": "{\"ts\":12345}",
    18  #   "ts": 12345000000
    19  # }
    20  ```