syncterval

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 2 Imported by: 10

README

Go Syncterval

donation link

A synchronized interval for go.

Rather than creating a new go routine for every repetitive task, if that task is low priority, you can use this module to share one routine with other modules.

Installation


  go get github.com/AspieSoft/go-syncterval

Usage


import (
  "fmt"
  "time"

  "github.com/AspieSoft/go-syncterval"
)

func loopFn(){
  fmt.Println("This Loop Will Run Every 3 Seconds!")
}

func main(){
  syncterval.New(3 * time.Second, loopFn)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(t time.Duration, fn func())

Types

This section is empty.

Jump to

Keyboard shortcuts

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