sleep() function

The sleep() function delays execution by a specified duration.

*Function type: Miscellaneous*

  1. sleep(
  2. v: x,
  3. duration: 10s
  4. )

Parameters

v

Defines input tables. sleep() accepts piped-forward data and passes it on unmodified after the specified duration. If data is not piped-forward into sleep(), set v to specify a stream of tables. The examples below illustrate how.

*Data type: Record*

duration

The length of time to delay execution.

*Data type: Duration*

Examples

Delay execution in a chained query

  1. from(bucket: "example-bucket")
  2. |> range(start: -1h)
  3. |> sleep(duration: 10s)

Delay execution using a stream variable

  1. x = from(bucket: "example-bucket")
  2. |> range(start: -1h)
  3. sleep(v: x, duration: 10s)