func NewTimerSet(g *GlobalContext) *TimerSet {
	s := g.Env.GetTimers()
	sel := TimerNone
	for _, c := range s {
		switch c {
		case 'a':
			sel |= TimerAPI
		case 'x':
			sel |= TimerXAPI
		case 'r':
			sel |= TimerRPC
		}
	}
	return &TimerSet{sel: sel, Contextified: Contextified{g}}
}
NewTimerSet looks into the given context for configuration information
about how to set up timers.  It then returns the corresponding TimerSet.
package libkb
import (
	"time"
)
type SimpleTimer struct {
	total int64
	start *time.Time
}
func (s *SimpleTimer) Start() {
	if s.start == nil {
		tmp := time.Now()
		s.start = &tmp
	}
}
func (s *SimpleTimer) Stop() int64 {
	if s.start != nil {
		tmp := time.Now()
		dur := tmp.Sub(*s.start)
		s.total += dur.Nanoseconds()
	} else {
		panic("SimpleTimer Stop()'ed without being started")
	}
	return s.GetTotal()
}
func (s *SimpleTimer) GetTotal() int64 {
	return s.total
}
func (s *SimpleTimer) Reset() {
	s.total = 0
}
type ReportingTimer interface {
	Report(prefix string)
}
type ReportingTimerReal struct {
	SimpleTimer
	Contextified
}
func NewReportingTimerReal(ctx Contextified) *ReportingTimerReal {
	return &ReportingTimerReal{Contextified: ctx}
}
func (r *ReportingTimerReal) Report(prefix string) {
	dur := r.Stop()
	r.Reset()
	r.G().Log.Info("timer: %s [%d ms]", prefix, dur/1000/1000)
}
type ReportingTimerDummy struct{}
func (r ReportingTimerDummy) Report(prefix string) {}
type TimerSelector int
const (
	TimerNone TimerSelector = 0
	TimerAPI TimerSelector = 1 << iota
	TimerXAPI
	TimerRPC
)
type TimerSet struct {
	sel TimerSelector
	Contextified
}