laps

package
v1.123.3 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 1 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package laps times the consecutive steps of one operation for its log line.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Laps

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

Laps holds how long each step of an operation took. A nil *Laps times nothing, so a step can be lapped whether or not anyone asked for it.

func Start

func Start() *Laps

Start begins timing the first step now.

func (*Laps) Attrs

func (l *Laps) Attrs() []any

Attrs returns each step and its duration as alternating key-value arguments for slog.

func (*Laps) Lap

func (l *Laps) Lap(step string)

Lap ends the current step, naming it step, and begins the next.

Jump to

Keyboard shortcuts

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