mirror of
https://gitee.com/johng/gf
synced 2026-07-09 06:50:30 +08:00
README updates
This commit is contained in:
@ -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>
|
||||
|
||||
@ -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>
|
||||
|
||||
24
g/os/gtimer/gtimer_z_example_test.go
Normal file
24
g/os/gtimer/gtimer_z_example_test.go
Normal 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 { }
|
||||
}
|
||||
@ -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
17
geg/os/gtimer/gtimer3.go
Normal 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 { }
|
||||
}
|
||||
Reference in New Issue
Block a user