ssa: cache types named in runtime

This commit is contained in:
visualfc
2024-09-11 20:20:29 +08:00
parent 67c9a14902
commit be3c4ab24a
3 changed files with 70 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
package timeout
import (
"time"
"github.com/goplus/llgo/_demo/async/async"
)
func Timeout(d time.Duration) async.Future[async.Void] {
return async.Async(func(resolve func(async.Void)) {
go func() {
time.Sleep(d)
resolve(async.Void{})
}()
})
}