func FromContext(ctx context.Context) *Timer {
	timer, ok := ctx.Value("timer").(*Timer)
	if !ok {
		return &Timer{}
	}
	return timer
}
FromContext creates a new context with the timer included
package timer
import (
	"fmt"
	"time"
	"golang.org/x/net/context"
)
type Timer struct {
	tsRequestHeaders int64
	tsResponseHeaders int64
	tsResponseDone int64
}
func (t Timer) String() string {
	if t.tsRequestHeaders == 0 {
		return "timer"
	}
	return fmt.Sprintf(
		"%.2fms total, %.2fms to response headers, %.2fms sending response body",
		float64(t.tsResponseDone-t.tsRequestHeaders)/1000000.0,
		float64(t.tsResponseHeaders-t.tsRequestHeaders)/1000000.0,
		float64(t.tsResponseDone-t.tsResponseHeaders)/1000000.0,
	)
}
func (t *Timer) RequestHeaders() {
	t.tsRequestHeaders = time.Now().UnixNano()
}
func (t *Timer) ResponseHeaders() {
	t.tsResponseHeaders = time.Now().UnixNano()
}
func (t *Timer) ResponseDone() {
	t.tsResponseDone = time.Now().UnixNano()
}
func (t *Timer) NewContext(ctx context.Context) context.Context {
	return context.WithValue(ctx, "timer", t)
}