ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# 组件源码 ``` /** * <b>方法描述:</b> 当期线程休眠 <br/> * <b>创建者:</b> admin <br/> * <b>创建时间:</b> 2018-05-08 17:53:57 <br/> * * @param millis 入参|休眠时间|{@link long} * @return -1 异常<br/> * 1 成功<br/> */ @Component(label = "当期线程休眠", style = "判断型", type = "同步组件", comment = "当前线程休眠指定时间,单位毫秒", version = "1.0.0", deprecated = false, author = "admin", date = "2018-05-08 05:53:57") @InParams(param = { @Param(name = "millis", comment = "休眠时间", type = long.class) }) @Returns(returns = { @Return(id = "-1", desp = "异常"), @Return(id = "1", desp = "成功") }) public static ResultBase P_sleep(long millis) { try { Thread.currentThread().sleep(millis); } catch (InterruptedException e) { AppLog.error(e); return ResultBase.newExceptionResult("TPTK0008", "线程wait被中断:" + e); } return ResultBase.newSuccessResult(); } ``` # 交易中组件使用方式 ![](https://img.kancloud.cn/af/f5/aff5ef6e51c907ac7bedf786f7f7c485_1870x889.png) # 参数说明及示例 ## 入口参数 休眠时间:设置当前线程的休眠时间,示例: `Long.valueOf("6000")`