+ xiang.flow.Sleep
This commit is contained in:
parent
e21f93af45
commit
47ccd31e69
1 changed files with 12 additions and 0 deletions
|
|
@ -1,6 +1,8 @@
|
|||
package helper
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/yaoapp/gou"
|
||||
"github.com/yaoapp/kun/utils"
|
||||
)
|
||||
|
|
@ -60,6 +62,8 @@ func init() {
|
|||
gou.RegisterProcessHandler("xiang.helper.Print", ProcessPrint)
|
||||
gou.AliasProcess("xiang.helper.Print", "xiang.sys.Print")
|
||||
|
||||
gou.RegisterProcessHandler("xiang.flow.Sleep", ProcessSleep)
|
||||
|
||||
}
|
||||
|
||||
// ProcessPrint xiang.helper.Print 打印语句
|
||||
|
|
@ -68,3 +72,11 @@ func ProcessPrint(process *gou.Process) interface{} {
|
|||
utils.Dump(process.Args...)
|
||||
return nil
|
||||
}
|
||||
|
||||
// ProcessSleep xiang.flow.Sleep 等待
|
||||
func ProcessSleep(process *gou.Process) interface{} {
|
||||
process.ValidateArgNums(1)
|
||||
ms := process.ArgsInt(0)
|
||||
time.Sleep(time.Duration((ms * int(time.Millisecond))))
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue