# blade create script delay

shell 脚本函数执行延迟

## 介绍

通过指定脚本和函数执行延迟场景。

## 参数

```
--time string      延迟时间，单位是毫秒（必要参数）
--timeout string   设定运行时长，单位是秒，通用参数
--file string      脚本路径（必要参数）
--function-name string  脚本中的函数名（必要参数） 
```

## 案例

```
#  blade create script delay --time 10000 --file test.sh --function-name start0

{"code":200,"success":true,"result":"b6a0f477b7fb1f4c"}

# 会在脚本中添加如下命令：
start0() {
sleep 10.000000
...
}
```

## 实现原理

备份原有脚本，根据函数名添加 sleep 命令

## 常见问题

Q: {"code":602,"success":false,"error":"get too many lines by the install function name"} A：查找到多个函数，不能执行


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://chaosblade-io.gitbook.io/chaosblade-help-zh-cn/blade-create-script-delay.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
