timer

package
v1.10.1-ddls413.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package timer used for timing events

Used by httphandler to time how long calls to urls (like the api) take to process

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ts

type Ts struct {
	Start time.Time `json:"start"`
	End   time.Time `json:"end"`
}

Ts is for timers in test / benchmarks

func New

func New() *Ts

func (*Ts) Duration added in v1.3.0

func (t *Ts) Duration() float64

Duration works out the diff between the stop and start time and returns the seconds gap as a float

func (*Ts) Seconds

func (t *Ts) Seconds() string

Seconds calls Duration and converts that to a string

func (*Ts) Stop

func (t *Ts) Stop() *Ts

Stop sets the value of End to the current time

Jump to

Keyboard shortcuts

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