timer

package
v0.0.54 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: BSD-3-Clause Imports: 2 Imported by: 1

Documentation

Overview

Package timer provides a simple timer for measuring the duration of code execution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Timer added in v0.0.46

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

Timer is a simple timer for measuring the duration of code execution.

func Conditional

func Conditional(condition bool) *Timer

Conditional returns a new timer that is only active if the condition is true.

func New

func New() *Timer

New returns a new timer.

func (*Timer) Checkpoint added in v0.0.46

func (t *Timer) Checkpoint(label string)

Checkpoint prints the duration since the last checkpoint and resets the timer.

func (*Timer) Reset added in v0.0.46

func (t *Timer) Reset()

Reset resets the timer.

Jump to

Keyboard shortcuts

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