mirror of
https://github.com/duke-git/lancet.git
synced 2026-11-16 05:12:11 +08:00
test&doc: add example and update doc for function package
This commit is contained in:
1 parent
be444f521d
commit
ca2a51b37e
8 files changed
+136
-70
No files matched your search
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user