counter

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter struct {
	// contains filtered or unexported fields
}
Example
package main

import (
	"time"

	"676f.dev/trout/counter"
	"github.com/fatih/color"
)

func main() {
	c := counter.NewCounter(color.HiCyanString("Hello")+"(", "x)")
	time.Sleep(1 * time.Second)
	c.Inc()
	time.Sleep(1 * time.Second)
	c.Inc()
	time.Sleep(1 * time.Second)
	c.Inc()
	time.Sleep(1 * time.Second)

	c.End()
}
Output:

func NewCounter

func NewCounter(prefix string, suffix string) *Counter

func (*Counter) End

func (c *Counter) End()

func (*Counter) Inc

func (c *Counter) Inc()

Jump to

Keyboard shortcuts

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