README updates

This commit is contained in:
John
2019-01-17 20:04:17 +08:00
parent c17352b8af
commit efe2535977
5 changed files with 48 additions and 3 deletions

View File

@ -92,6 +92,8 @@ func main() {
# Donators
<a href="https://gitee.com/zhuhuan12" target="_blank" title="zhuhuan12"><img src="https://gitee.com/uploads/39/751839_zhuhuan12.png" width="60" align="left"></a>
<a href="https://gitee.com/zfan_codes" target="_blank" title="范钟"><img src="https://images.gitee.com/uploads/32/2044832_zfan_codes.png" width="60" align="left"></a>
<a href="https://gitee.com/hailaz" target="_blank" title="HaiLaz"><img src="https://gitee.com/uploads/87/1273187_hailaz.png" width="60" align="left"></a>

View File

@ -97,6 +97,8 @@ func main() {
# 捐赠者
<a href="https://gitee.com/zhuhuan12" target="_blank" title="zhuhuan12"><img src="https://gitee.com/uploads/39/751839_zhuhuan12.png" width="60" align="left"></a>
<a href="https://gitee.com/zfan_codes" target="_blank" title="范钟"><img src="https://images.gitee.com/uploads/32/2044832_zfan_codes.png" width="60" align="left"></a>
<a href="https://gitee.com/hailaz" target="_blank" title="HaiLaz"><img src="https://gitee.com/uploads/87/1273187_hailaz.png" width="60" align="left"></a>

View File

@ -0,0 +1,24 @@
// Copyright 2019 gf Author(https://gitee.com/johng/gf). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://gitee.com/johng/gf.
package gtimer_test
import (
"fmt"
"gitee.com/johng/gf/g/os/gtimer"
"time"
)
func ExampleAdd() {
now := time.Now()
interval := 1400*time.Millisecond
gtimer.Add(interval, func() {
fmt.Println(time.Now(), time.Duration(time.Now().UnixNano() - now.UnixNano()))
now = time.Now()
})
select { }
}

View File

@ -1,9 +1,9 @@
package main
import (
"fmt"
"gitee.com/johng/gf/g/os/gtimer"
"time"
"fmt"
"gitee.com/johng/gf/g/os/gtimer"
"time"
)
func main() {

17
geg/os/gtimer/gtimer3.go Normal file
View File

@ -0,0 +1,17 @@
package main
import (
"gitee.com/johng/gf/g/os/glog"
"gitee.com/johng/gf/g/os/gtimer"
"time"
)
func main() {
interval := time.Millisecond
gtimer.AddSingleton(interval, func() {
glog.Println("doing")
time.Sleep(2*time.Second)
})
select { }
}