add sleep and update README.md

This commit is contained in:
vcaesar 2018-01-16 19:31:19 +08:00
parent 30660e6833
commit e1444437c2
3 changed files with 9 additions and 3 deletions

View File

@ -249,7 +249,7 @@ func main() {
## Plans
- Update Find an image on screen, read pixels from an image
- Update Window Handle
- Support UTF-8, transitional plan: TypeStr
- Linux support UTF-8
- Try support Android, maybe support IOS
## Donate

View File

@ -247,7 +247,7 @@ func main() {
## Plans
- 更新 Find an image on screen, read pixels from an image
- 更新 Window Handle
- 支持 UTF-8, 过渡方案: TypeStr
- Linux 支持 UTF-8
- 尝试支持 Android, 也许支持 IOS
## Donate

View File

@ -54,6 +54,7 @@ import (
"reflect"
"runtime"
"strings"
"time"
"unsafe"
// "syscall"
@ -62,7 +63,7 @@ import (
)
const (
version string = "v0.47.0.481, Mount Cook!"
version string = "v0.47.0.485, Mount Cook!"
)
type (
@ -105,6 +106,11 @@ func Try(fun func(), handler func(interface{})) {
fun()
}
// Sleep time.Sleep
func Sleep(tm float64) {
time.Sleep(time.Duration(tm) * time.Second)
}
// GoString teans C.char to string
func GoString(char *C.char) string {
return C.GoString(char)