timing

package
v0.0.0-...-465a192 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package timing contains utility functions to measure execution times. It identifies measure by names to be able to start and stop the measurements from completely different parts of the code without having to share a variable.

This package can be configured to use any object that implements the Output interface from the output package to write it's results.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartMeasure

func StartMeasure(name string)

StartMeasure starts a time measure identified by a name.

func StopMeasure

func StopMeasure(name string) time.Duration

StopMeasure stops a time measure identified by a name, prints the result to the current output interface and returns the measured time. Returns 0 if no measure was started with that name.

func StopMeasureAndLog

func StopMeasureAndLog(name string)

StopMeasureAndLog prints the value to Lvl1 instead of returning it

func StopMeasureAndLogWithInfo

func StopMeasureAndLogWithInfo(name, info string)

StopMeasureAndLog prints the value to Lvl1 instead of returning it (logs "info" too)

Types

This section is empty.

Jump to

Keyboard shortcuts

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