tendermint: github.com/tendermint/tendermint/types/time Index | Files

package time

import "github.com/tendermint/tendermint/types/time"


Package Files


func Canonical Uses

func Canonical(t time.Time) time.Time

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 Now Uses

func Now() time.Time

Now returns the current time in UTC with no monotonic component.

func WeightedMedian Uses

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.

type WeightedTime Uses

type WeightedTime struct {
    Time   time.Time
    Weight int64

WeightedTime for computing a median.

func NewWeightedTime Uses

func NewWeightedTime(time time.Time, weight int64) *WeightedTime

NewWeightedTime with time and weight.

Package time imports 2 packages (graph) and is imported by 65 packages. Updated 2018-09-07. Refresh now. Tools for package owners.