feat: call function

This commit is contained in:
debugtalk
2021-10-03 10:04:29 +08:00
parent fd4837c852
commit bb9456cc7f
3 changed files with 51 additions and 0 deletions

11
builtin/function.go Normal file
View File

@@ -0,0 +1,11 @@
package builtin
import "time"
var FunctionsMap = map[string]interface{}{
"sleep": Sleep,
}
func Sleep(nSecs int) {
time.Sleep(time.Duration(nSecs) * time.Second)
}