// NewPCPTimer creates a new PCPTimer instance of the specified unit.
// It requires a metric name and a TimeUnit for construction.
// It can optionally take a couple of description strings.
// Internally it uses a PCP SingletonMetric.
NewPCPTimer creates a new PCPTimer instance of the specified unit.
It requires a metric name and a TimeUnit for construction.
It can optionally take a couple of description strings.
Internally it uses a PCP SingletonMetric.
// NewPCPTimer creates a new PCPTimer instance of the specified unit . // It requires a metric name and a TimeUnit for construction . // It can optionally take a couple of description strings . // Internally it uses a PCP SingletonMetric .
func NewPCPTimer(name string, unit TimeUnit, desc ...string) (*PCPTimer, error) {
	d, err := newpcpMetricDesc(name, DoubleType, DiscreteSemantics, unit, desc...)
	if err != nil {
		return nil, err
	}
	sm, err := newpcpSingletonMetric(float64(0), d)
	if err != nil {
		return nil, err
	}
	return &PCPTimer{sm, sync.Mutex{}, false, time.Time{}}, nil
}
func NewPCPTimer ( name string , unit TimeUnit , desc ... string ) ( * PCPTimer , error ) { d , err := newpcpMetricDesc ( name , DoubleType , DiscreteSemantics , unit , desc ... ) if err != nil { return nil , err } sm , err := newpcpSingletonMetric ( float64 ( 0 ) , d ) if err != nil { return nil , err } return & PCPTimer { sm , sync . Mutex { } , false , time . Time { } } , nil }
NewPCPTimer creates a new PCPTimer instance of the specified unit.
NewPCPTimer creates a new PCPTimer instance of the specified unit .