timing

package
Version: v0.0.0-...-73659f3 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 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).

Source Files

Jump to

Keyboard shortcuts

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