Paul Lecuq
36c5d6f2ed
- web service with json support - web page - cron service to update database infos
20 lines
260 B
Go
20 lines
260 B
Go
//+build debug
|
|
|
|
package oncer
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
)
|
|
|
|
func log(name string, fn func()) func() {
|
|
return func() {
|
|
start := time.Now()
|
|
if len(name) > 80 {
|
|
name = name[(len(name) - 80):]
|
|
}
|
|
defer fmt.Println(name, time.Now().Sub(start))
|
|
fn()
|
|
}
|
|
}
|