Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Canonical ¶
Canonical returns UTC time with no monotonic component. Stripping the monotonic component is for time equality. See https://github.com/tendermint/tendermint/pull/2203#discussion_r215064334
func Since ¶ added in v1.0.0
Since returns the time elapsed since t. It is shorthand for time.Now().Sub(t).
func Until ¶ added in v1.0.0
Until returns the duration until t. It is shorthand for t.Sub(time.Now()).
func WeightedMedian ¶
func WeightedMedian(weightedTimes []*WeightedTime, totalVotingPower int64) (res time.Time)
WeightedMedian computes weighted median time for a given array of WeightedTime and the total voting power.
Types ¶
type DefaultSource ¶ added in v1.0.0
type DefaultSource struct{}
DefaultSource implements the Source interface using the system clock provided by the standard library.
func (DefaultSource) Now ¶ added in v1.0.0
func (DefaultSource) Now() time.Time
type WeightedTime ¶
TODO: find which commit removed this and make sure it's in our list WeightedTime for computing a median.
func NewWeightedTime ¶
func NewWeightedTime(time time.Time, weight int64) *WeightedTime
NewWeightedTime with time and weight.