1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-06 13:42:28 +08:00

test&doc: add example and update doc for function package

This commit is contained in:
dudaodong
2023-01-06 17:12:32 +08:00
parent be444f521d
commit ca2a51b37e
8 changed files with 136 additions and 70 deletions

View File

@@ -0,0 +1,22 @@
package function
import "fmt"
func ExampleWatcher() {
w := NewWatcher()
w.Start()
longRunningTask()
w.Stop()
// eapsedTime := w.GetElapsedTime().Milliseconds()
fmt.Println("foo")
w.Reset()
// Output:
// foo
}