timing

package
v0.0.0-...-15a9a0c Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package timing provides functions to record timing information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stage

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

Stage represents a discrete unit of work that is being timed.

func Start

func Start(ctx context.Context, name string) (context.Context, *Stage)

Start starts and returns a new Stage named name.

Example usage to report the time used until the end of the current function:

ctx, st := timing.Start(ctx, "my_stage")
defer st.End()

func (*Stage) End

func (st *Stage) End()

End ends the stage. Child stages are recursively examined and also ended (although we expect them to have already been ended).

Jump to

Keyboard shortcuts

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