Source File
time.go
Belonging Package
go101.org/nstd
package nstdimport ()// ElapsedTimeLogFunc returns a function which prints the duration elapsed// since the time the function is invoked.//// Use example://// logElapsedTime := nstd.ElapsedTimeLogFunc("")// ... // do task 1// logElapsedTime("task 1:")// ... // do task 1// logElapsedTime("task 2:")func ( string) func( string) bool {var stringif != "" {= " "}var = time.Now()return func( string) bool {var stringif != "" {= " "}log.Printf("%s%s%s%s%s", , , , , time.Since())return true}}
![]() |
The pages are generated with Golds v0.7.9-preview. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |