timecounter

package
v0.0.0-...-190864c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package timecounter provides functionality for aggregating times based on a string key.

Index

Constants

View Source
const (
	// CounterGroupDefTime is the counter for definition times.
	CounterGroupDefTime counterGroupType = iota + 1
	// CounterGroupLHSDefTime is the counter for LHS definition times.
	CounterGroupLHSDefTime
	// CounterGroupEvalTime is the counter for eval times.
	CounterGroupEvalTime
	// CounterGroupHeadEvalTime is the counter for head eval times.
	CounterGroupHeadEvalTime
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	// contains filtered or unexported fields
}

Group collects eval-related timeCounters.

func (*Group) AddTime

func (tcg *Group) AddTime(
	counter counterGroupType,
	key string,
	elapsed float64,
)

AddTime adds a floating-point time to a particular timeCounter, selected with a counterGroupType.

func (*Group) Init

func (tcg *Group) Init()

Init initializes the Group with empty maps.

func (*Group) String

func (tcg *Group) String() string

Prints the counter group as a formatted string.

func (*Group) Update

func (tcg *Group) Update(other *Group)

Update adds another Group to this one.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL