mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-04 12:52:28 +08:00
23 lines
227 B
Go
23 lines
227 B
Go
package function
|
|
|
|
import "fmt"
|
|
|
|
func ExampleWatcher() {
|
|
w := NewWatcher()
|
|
|
|
w.Start()
|
|
|
|
longRunningTask()
|
|
|
|
w.Stop()
|
|
|
|
// eapsedTime := w.GetElapsedTime().Milliseconds()
|
|
|
|
fmt.Println("foo")
|
|
|
|
w.Reset()
|
|
|
|
// Output:
|
|
// foo
|
|
}
|