tracktime

package
v0.0.131 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package tracktime provides special struct to describe timer and log duration between start and stop points

example:

func SomeBodyDo() {
    timer := tracktime.Start("Some Body Do")
    defer func() {
        timer.Stop()
        timer.Log()
    }()
    ...
    Here some actions
    ...
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tracker added in v0.0.93

type Tracker struct {
	Label    string
	Run      time.Time
	Finish   time.Time
	Duration time.Duration
}

Tracker struct save info about timer

func Start

func Start(label string) *Tracker

Start create new Tracker

func (*Tracker) Log added in v0.0.93

func (t *Tracker) Log()

Log logging Tracker info

func (*Tracker) Stop added in v0.0.93

func (t *Tracker) Stop()

Stop fix time moment in Tracker

Jump to

Keyboard shortcuts

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