We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8d789fd + d704624 commit 7ae2c90Copy full SHA for 7ae2c90
time/api.go
@@ -22,8 +22,9 @@ func UnixNano(L *lua.LState) int {
22
23
// Sleep lua time.sleep(number) port of go time.Sleep(int64)
24
func Sleep(L *lua.LState) int {
25
- val := L.CheckNumber(1)
26
- time.Sleep(time.Duration(val) * time.Second)
+ val := float64(L.CheckNumber(1))
+ sec := float64(time.Second)
27
+ time.Sleep(time.Duration(val * sec))
28
return 0
29
}
30
0 commit comments