Source File
time.go
Belonging Package
go101.org/nstd
package nstd
import (
)
// 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 string
if != "" {
= " "
}
var = time.Now()
return func( string) bool {
var string
if != "" {
= " "
}
log.Printf("%s%s%s%s%s", , , , , time.Since())
return true
}
}
The pages are generated with Golds v0.7.3. (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. |